public void outVisitant(VisitantBean visitant) {
    String selectSql = query.outVisitant_SelectSql;
    String deleteSql = query.outVisitant_DeleteSql;
    String insertSql = query.outVisitant_InsertSql;

    try {
      VisitantBean tempVisitant = null;
      connection = DBManager.getConnection();
      preparedStatement = connection.prepareStatement(selectSql);
      preparedStatement.setInt(1, visitant.getPassNum());
      resultSet = preparedStatement.executeQuery();
      DBManager.setAutoCommit(connection, false);
      if (resultSet.next()) {
        tempVisitant = new VisitantBean(resultSet);
        preparedStatement = connection.prepareStatement(insertSql);
        preparedStatement.setInt(1, tempVisitant.getVisitnumber());
        preparedStatement.setTimestamp(2, tempVisitant.getInTime());
        preparedStatement.setInt(3, tempVisitant.getPassNum());
        preparedStatement.setString(4, tempVisitant.getVisitantName());
        preparedStatement.setString(5, tempVisitant.getCompany());
        preparedStatement.setString(6, tempVisitant.getPhone());
        preparedStatement.setTimestamp(7, visitant.getOutTime());
        preparedStatement.setInt(8, 0);
        preparedStatement.executeUpdate();

        preparedStatement = connection.prepareStatement(deleteSql);
        preparedStatement.setInt(1, visitant.getPassNum());
        preparedStatement.executeUpdate();
      }
      DBManager.endAutoCommit(connection, true);
    } catch (SQLException e) {
      DBManager.endAutoCommit(connection, false);
      System.out.println(query.outVisitant_Exception);
    } finally {
      DBManager.close(resultSet, connection, preparedStatement);
    }
  } // outVisitant