@WebMethod
  public List<Asset> getFasilitasAset(int idAset) throws SQLException {
    String query =
        "SELECT *  FROM "
            + FASILITAS_ASET_TABLE
            + " JOIN "
            + ASSET_TABLE
            + " ON "
            + FASILITAS_ASET_TABLE
            + ".id_fasilitas="
            + ASSET_TABLE
            + ".id"
            + " WHERE id_aset = "
            + idAset;
    System.out.println(query);
    ResultSet rs = executeQuery(query);

    List<Asset> assets = null;
    while (rs.next()) {
      if (rs.isFirst()) assets = new ArrayList<Asset>();
      Asset asset = new Asset();
      asset.setId(rs.getInt("id"));
      asset.setNama(rs.getString("nama"));
      asset.setKategori(rs.getString("kategori"));
      asset.setKategori(rs.getString("jenis"));
      asset.setTanggalMasuk(rs.getDate("tanggal_masuk"));
      asset.setKondisi(AssetCondition.getInstance(rs.getString("kondisi")));
      asset.setPemilik(rs.getString("pemilik"));
      asset.setVendor(getVendorAset(rs.getInt("id_vendor")));
      asset.setHarga(rs.getString("harga"));
      asset.setPublicAsset(rs.getBoolean("is_public"));
      assets.add(asset);
    }
    return assets;
  }
  public void deleteISOTimezone(
      CFSecurityAuthorization Authorization, CFSecurityISOTimezoneBuff Buff) {
    final String S_ProcName = "deleteISOTimezone";
    ResultSet resultSet = null;
    try {
      Connection cnx = schema.getCnx();
      short ISOTimezoneId = Buff.getRequiredISOTimezoneId();

      String sql =
          "SELECT "
              + schema.getLowerDbSchemaName()
              + ".sp_delete_isotz( ?, ?, ?, ?, ?"
              + ", "
              + "?"
              + ", "
              + "?"
              + " ) as DeletedFlag";
      if (stmtDeleteByPKey == null) {
        stmtDeleteByPKey = cnx.prepareStatement(sql);
      }
      int argIdx = 1;
      stmtDeleteByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtDeleteByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
      stmtDeleteByPKey.setString(
          argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
      stmtDeleteByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
      stmtDeleteByPKey.setLong(
          argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
      stmtDeleteByPKey.setShort(argIdx++, ISOTimezoneId);
      stmtDeleteByPKey.setInt(argIdx++, Buff.getRequiredRevision());
      ;
      resultSet = stmtDeleteByPKey.executeQuery();
      if (resultSet.next()) {
        boolean deleteFlag = resultSet.getBoolean(1);
        if (resultSet.next()) {
          throw CFLib.getDefaultExceptionFactory()
              .newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response");
        }
      } else {
        throw CFLib.getDefaultExceptionFactory()
            .newRuntimeException(
                getClass(),
                S_ProcName,
                "Expected 1 record result set to be returned by delete, not 0 rows");
      }
    } catch (SQLException e) {
      throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
    } finally {
      if (resultSet != null) {
        try {
          resultSet.close();
        } catch (SQLException e) {
        }
        resultSet = null;
      }
    }
  }
  // Needs a connection so it can fetch more stuff lazily
  Copy(ResultSet rs) throws SQLException {
    super();

    copyId = rs.getInt("copy#");
    bibId = rs.getInt("bib#");
    note = rs.getString("pac_note");

    location = rs.getString("location");
    locationName = rs.getString("location_name");
    collectionDescr = rs.getString("collection_descr");
    collection = rs.getString("collection");

    callNumber =
        new CallNumber(
            rs.getString("call_number"),
            rs.getString("call_type"),
            rs.getString("copy_number"),
            rs.getString("call_type_hint"));
    callType = rs.getString("call_type");
    callTypeHint = rs.getString("call_type_hint");
    callTypeName = rs.getString("call_type_name");

    mediaType = rs.getString("media_type");
    mediaTypeDescr = rs.getString("media_descr");
    summaryOfHoldings = rs.getBoolean("summary_of_holdings");
    itemType = rs.getString("itype");
    itemTypeDescr = rs.getString("idescr");
  }
Exemplo n.º 4
0
  /**
   * Get organisation's nomination rater status
   *
   * @param iOrgID
   * @return
   * @throws SQLException
   * @throws Exception
   * @author Desmond
   */
  public boolean getNomRater(int iOrgID) throws SQLException, Exception {
    String query = "SELECT NominationModule FROM tblOrganization WHERE PKOrganization =" + iOrgID;
    boolean iNomRater = true;

    Connection con = null;
    Statement st = null;
    ResultSet rs = null;

    try {
      con = ConnectionBean.getConnection();
      st = con.createStatement();
      rs = st.executeQuery(query);

      if (rs.next()) {
        iNomRater = rs.getBoolean(1);
      }

    } catch (Exception E) {
      System.err.println("Organization.java - getNomRater - " + E);
    } finally {
      ConnectionBean.closeRset(rs); // Close ResultSet
      ConnectionBean.closeStmt(st); // Close statement
      ConnectionBean.close(con); // Close connection
    }

    return iNomRater;
  } // End getNomRater()
 public void deleteTSecGroupByUNameIdx(
     CFSecurityAuthorization Authorization, long argTenantId, String argName) {
   final String S_ProcName = "deleteTSecGroupByUNameIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "SELECT "
             + schema.getLowerDbSchemaName()
             + ".sp_delete_tsecgrp_by_unameidx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " ) as DeletedFlag";
     if (stmtDeleteByUNameIdx == null) {
       stmtDeleteByUNameIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtDeleteByUNameIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtDeleteByUNameIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtDeleteByUNameIdx.setLong(argIdx++, argTenantId);
     stmtDeleteByUNameIdx.setString(argIdx++, argName);
     resultSet = stmtDeleteByUNameIdx.executeQuery();
     if (resultSet.next()) {
       boolean deleteFlag = resultSet.getBoolean(1);
       if (resultSet.next()) {
         throw CFLib.getDefaultExceptionFactory()
             .newRuntimeException(getClass(), S_ProcName, "Did not expect multi-record response");
       }
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newRuntimeException(
               getClass(),
               S_ProcName,
               "Expected 1 record result set to be returned by delete, not 0 rows");
     }
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
  protected CFInternetURLProtocolBuff unpackURLProtocolResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackURLProtocolResultSetToBuff";
    int idxcol = 1;
    CFInternetURLProtocolBuff buff = schema.getFactoryURLProtocol().newBuff();
    {
      String colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedByUserId(null);
      } else {
        buff.setCreatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedAt(null);
      } else {
        buff.setCreatedAt(CFDbTestPgSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedByUserId(null);
      } else {
        buff.setUpdatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedAt(null);
      } else {
        buff.setUpdatedAt(CFDbTestPgSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredURLProtocolId(resultSet.getInt(idxcol));
    idxcol++;
    buff.setRequiredName(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredDescription(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredIsSecure(resultSet.getBoolean(idxcol));
    idxcol++;

    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }
Exemplo n.º 7
0
    protected Map<String, Object> getARow(
        ResultSet resultSet,
        boolean convertType,
        List<String> colNames,
        Map<String, Integer> fieldNameVsType) {
      if (resultSet == null) return null;
      Map<String, Object> result = new HashMap<>();
      for (String colName : colNames) {
        try {
          if (!convertType) {
            // Use underlying database's type information except for BigDecimal and BigInteger
            // which cannot be serialized by JavaBin/XML. See SOLR-6165
            Object value = resultSet.getObject(colName);
            if (value instanceof BigDecimal || value instanceof BigInteger) {
              result.put(colName, value.toString());
            } else {
              result.put(colName, value);
            }
            continue;
          }

          Integer type = fieldNameVsType.get(colName);
          if (type == null) type = Types.VARCHAR;
          switch (type) {
            case Types.INTEGER:
              result.put(colName, resultSet.getInt(colName));
              break;
            case Types.FLOAT:
              result.put(colName, resultSet.getFloat(colName));
              break;
            case Types.BIGINT:
              result.put(colName, resultSet.getLong(colName));
              break;
            case Types.DOUBLE:
              result.put(colName, resultSet.getDouble(colName));
              break;
            case Types.DATE:
              result.put(colName, resultSet.getTimestamp(colName));
              break;
            case Types.BOOLEAN:
              result.put(colName, resultSet.getBoolean(colName));
              break;
            case Types.BLOB:
              result.put(colName, resultSet.getBytes(colName));
              break;
            default:
              result.put(colName, resultSet.getString(colName));
              break;
          }
        } catch (SQLException e) {
          logError("Error reading data ", e);
          wrapAndThrow(SEVERE, e, "Error reading data from database");
        }
      }
      return result;
    }
Exemplo n.º 8
0
 private boolean isAutoIncrementField(ResultSet columnNames) throws SQLException {
   try {
     Boolean autoIncr = columnNames.getBoolean(AUTOINCREMENT_COLUMN);
     if (autoIncr != null) {
       return autoIncr;
     }
   } catch (SQLException ignore) {
     // ignore
   }
   try {
     Boolean identity = columnNames.getBoolean(IDENTITY_COLUMN);
     if (identity != null) {
       return identity;
     }
   } catch (SQLException ignore) {
     // ignore
   }
   return false;
 }
Exemplo n.º 9
0
  ConcurrentHashMap<String, WordWar> loadWars() {
    Connection con = null;
    Channel channel;
    String user;
    ConcurrentHashMap<String, WordWar> wars = new ConcurrentHashMap<>(32);

    try {
      con = pool.getConnection(timeout);

      Statement s = con.createStatement();
      ResultSet rs = s.executeQuery("SELECT * FROM `wars`");

      while (rs.next()) {
        channel = Tim.channelStorage.channelList.get(rs.getString("channel"));
        user = rs.getString("starter");

        WordWar war =
            new WordWar(
                rs.getLong("base_duration"),
                rs.getLong("duration"),
                rs.getLong("remaining"),
                rs.getLong("time_to_start"),
                rs.getInt("total_chains"),
                rs.getInt("current_chain"),
                rs.getInt("delay"),
                rs.getBoolean("randomness"),
                rs.getString("name"),
                user,
                channel,
                rs.getInt("id"));

        wars.put(war.getName(false).toLowerCase(), war);
      }

      rs.close();
      s.close();
    } catch (SQLException ex) {
      Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
      try {
        if (con != null) {
          con.close();
        }
      } catch (SQLException ex) {
        Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE, null, ex);
      }
    }

    return wars;
  }
Exemplo n.º 10
0
 protected boolean executeOnlyIf(Connection con, String q) throws SQLException {
   if (q == null) return true;
   Statement stmt = null;
   try {
     stmt = con.createStatement();
     q = q.replace("$PREFIX", getPrefix());
     LOG.debug(" Executing query " + q);
     ResultSet rs = stmt.executeQuery(q);
     rs.next();
     boolean res = rs.getBoolean(1);
     LOG.debug("Result: " + res);
     return res;
   } catch (SQLException sqe) {
     LOG.error(sqe.getMessage() + " from " + q);
     throw sqe;
   } finally {
     try {
       if (stmt != null) {
         stmt.close();
       }
     } catch (Exception g) {
     }
   }
 }
  public StoredBlock get(Sha256Hash hash, boolean wasUndoableOnly) throws BlockStoreException {
    // Optimize for chain head
    if (chainHeadHash != null && chainHeadHash.equals(hash)) return chainHeadBlock;
    if (verifiedChainHeadHash != null && verifiedChainHeadHash.equals(hash))
      return verifiedChainHeadBlock;
    maybeConnect();
    PreparedStatement s = null;
    try {
      s =
          conn.get()
              .prepareStatement(
                  "SELECT chainWork, height, header, wasUndoable FROM headers WHERE hash = ?");
      // We skip the first 4 bytes because (on prodnet) the minimum target has 4 0-bytes
      byte[] hashBytes = new byte[28];
      System.arraycopy(hash.getBytes(), 3, hashBytes, 0, 28);
      s.setBytes(1, hashBytes);
      ResultSet results = s.executeQuery();
      if (!results.next()) {
        return null;
      }
      // Parse it.

      if (wasUndoableOnly && !results.getBoolean(4)) return null;

      BigInteger chainWork = new BigInteger(results.getBytes(1));
      int height = results.getInt(2);
      Block b = new Block(params, results.getBytes(3));
      b.verifyHeader();
      StoredBlock stored = new StoredBlock(b, chainWork, height);
      return stored;
    } catch (SQLException ex) {
      throw new BlockStoreException(ex);
    } catch (ProtocolException e) {
      // Corrupted database.
      throw new BlockStoreException(e);
    } catch (VerificationException e) {
      // Should not be able to happen unless the database contains bad
      // blocks.
      throw new BlockStoreException(e);
    } finally {
      if (s != null)
        try {
          s.close();
        } catch (SQLException e) {
          throw new BlockStoreException("Failed to close PreparedStatement");
        }
    }
  }
Exemplo n.º 12
0
  /**
   * buscaPorLogin
   *
   * @param nome String
   * @return ArrayList
   */
  public static ArrayList<Usuario> buscaPorLogin(String login) {
    SigeDataBase db = new SigeDataBase();
    try {
      String query =
          "SELECT cd_usuario as codigo, nome_usuario as nome,"
              + " cd_entidade as entidade, login, decode(senha,'base64')"
              + " as senha, cpf, ativo FROM usuarios WHERE lower(login) LIKE lower(?) ORDER BY nome_usuario";
      db.setPreparedStatement(
          db.getConn()
              .prepareStatement(
                  query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY));
      db.setString(1, '%' + login + '%');
      ResultSet rs = db.executeQuery();
      if (rs.next()) {
        ArrayList<Usuario> resultado = new ArrayList<Usuario>();
        do {
          Usuario usuario = new Usuario();
          Entidade entidade = (Entidade) EntidadeDAO.buscaPorCodigo(rs.getInt("entidade"));
          if (entidade != null) {
            usuario.setEntidade(entidade);
          } else {
            throw new SQLException("Entidade Não Existe");
          }
          usuario.setCodigo(rs.getInt("codigo"));
          usuario.setNomeCompleto(rs.getString("nome"));
          usuario.setLogin(rs.getString("login"));
          usuario.setSenha(rs.getString("senha"));
          usuario.setCPF(rs.getString("cpf"));
          usuario.setPermissoes(PermissaoDAO.buscaPorUsuario(usuario));
          usuario.setAtivo(rs.getBoolean("ativo"));
          resultado.add(usuario);
        } while (rs.next());
        rs.close();
        db.closeConnection();
        return resultado;
      }
      db.closeConnection();
      return null;

    } catch (SQLException ex) {
      ex.printStackTrace();
      return null;
    }
  }
Exemplo n.º 13
0
  /**
   * Get Organization
   *
   * @param iFKCompanyID
   * @return
   * @author James
   */
  public votblOrganization getOrganization(int iOrgID) {
    votblOrganization vo = new votblOrganization();
    Connection con = null;
    Statement st = null;
    ResultSet rs = null;

    String command = "SELECT * FROM tblOrganization WHERE PKOrganization= " + iOrgID;
    try {

      con = ConnectionBean.getConnection();
      System.out.println("con:" + con);
      st = con.createStatement();
      rs = st.executeQuery(command);

      if (rs.next()) {
        vo.setEmailNom(rs.getString("EmailNom"));
        vo.setEmailNomRemind(rs.getString("EmailNomRemind"));
        vo.setEmailPart(rs.getString("EmailPart"));
        vo.setEmailPartRemind(rs.getString("EmailPartRemind"));
        vo.setExtraModule(rs.getInt("ExtraModule"));
        vo.setFKCompanyID(rs.getInt("FKCompanyID"));
        vo.setNameSequence(rs.getInt("NameSequence"));
        vo.setOrganizationCode(rs.getString("OrganizationCode"));
        vo.setOrganizationLogo(rs.getString("OrganizationLogo"));
        vo.setOrganizationName(rs.getString("OrganizationName"));
        vo.setPKOrganization(rs.getInt("PKOrganization"));

        // Added by DeZ, 18/06/08, to add function to enable/disable Nominate Rater
        vo.setNomRater(rs.getBoolean("NominationModule"));
      }

    } catch (SQLException SE) {
      System.err.println("Organization.java - getOrganization - " + SE.getMessage());
    } finally {

      ConnectionBean.closeRset(rs); // Close ResultSet
      ConnectionBean.closeStmt(st); // Close statement
      ConnectionBean.close(con); // Close connection
    }

    return vo;
  }
  private Asset _getAset(int idAset) throws SQLException {
    String query = "SELECT * FROM " + ASSET_TABLE + " WHERE id = " + idAset;
    ResultSet rs = executeQuery(query);
    Asset asset = null;
    if (rs.next()) {
      asset = new Asset();
      asset.setId(rs.getInt("id"));
      asset.setNama(rs.getString("nama"));
      asset.setKategori(rs.getString("kategori"));
      asset.setKategori(rs.getString("jenis"));
      asset.setTanggalMasuk(rs.getDate("tanggal_masuk"));
      asset.setKondisi(AssetCondition.getInstance(rs.getString("kondisi")));
      asset.setPemilik(rs.getString("pemilik"));
      asset.setVendor(getVendorAset(rs.getInt("id_vendor")));
      asset.setHarga(rs.getString("harga"));
      asset.setPublicAsset(rs.getBoolean("is_public"));
    }

    return asset;
  }
Exemplo n.º 15
0
  /**
   * buscaPorCodigo
   *
   * @param codigo int
   * @return Usuario
   */
  public static Usuario buscaPorCodigo(int codigo) {
    SigeDataBase db = new SigeDataBase();

    try {
      String query =
          "SELECT cd_usuario as codigo, ativo, nome_usuario "
              + "as nome, cd_entidade as entidade, login,"
              + " decode(senha,'base64') as senha, cpf FROM usuarios"
              + " WHERE cd_usuario=? ORDER BY nome_usuario";
      db.prepareStatement(query);
      db.setInt(1, codigo);
      ResultSet rs = db.executeQuery();
      if (rs.next()) {
        Usuario usuario = new Usuario();
        Entidade entidade = EntidadeDAO.buscaPorCodigo(rs.getInt("entidade"));
        if (entidade != null) {
          usuario.setEntidade(entidade);
        } else {
          throw new SQLException("Entidade Nao Existe");
        }
        usuario.setCodigo(rs.getInt("codigo"));
        usuario.setNomeCompleto(rs.getString("nome"));
        usuario.setLogin(rs.getString("login"));
        usuario.setSenha(rs.getString("senha"));
        usuario.setCPF(rs.getString("cpf"));
        usuario.setAtivo(rs.getBoolean("ativo"));
        usuario.setPermissoes(PermissaoDAO.buscaPorUsuario(usuario));
        rs.close();
        db.closeConnection();
        return usuario;
      }
      db.closeConnection();
      return null;

    } catch (SQLException ex) {
      ex.printStackTrace();
      return null;
    }
  }
Exemplo n.º 16
0
  RelProtoDataType getRelDataType(
      DatabaseMetaData metaData, String catalogName, String schemaName, String tableName)
      throws SQLException {
    final ResultSet resultSet = metaData.getColumns(catalogName, schemaName, tableName, null);

    // Temporary type factory, just for the duration of this method. Allowable
    // because we're creating a proto-type, not a type; before being used, the
    // proto-type will be copied into a real type factory.
    final RelDataTypeFactory typeFactory = new SqlTypeFactoryImpl();
    final RelDataTypeFactory.FieldInfoBuilder fieldInfo = typeFactory.builder();
    while (resultSet.next()) {
      final String columnName = resultSet.getString(4);
      final int dataType = resultSet.getInt(5);
      final String typeString = resultSet.getString(6);
      final int size = resultSet.getInt(7);
      final int scale = resultSet.getInt(9);
      RelDataType sqlType = sqlType(typeFactory, dataType, size, scale, typeString);
      boolean nullable = resultSet.getBoolean(11);
      fieldInfo.add(columnName, sqlType).nullable(nullable);
    }
    resultSet.close();
    return RelDataTypeImpl.proto(fieldInfo.build());
  }
Exemplo n.º 17
0
  protected static synchronized void inicializa() throws Exception {

    if (listaObj == null) { // primeira utilização do gerente de objetos

      listaObj = new Vector();

      // Inicia a conexão com a base de dados
      Connection dbCon = BancoDados.abreConexao();
      Statement dbStmt = dbCon.createStatement();
      ResultSet dbRs;

      // seleciona todos objetos
      String str = "SELECT * FROM Disciplina ORDER BY Nome";
      BancoDadosLog.log(str);
      dbRs = dbStmt.executeQuery(str);

      while (dbRs.next()) {
        // Le dados da base
        String cod = dbRs.getString("cod");
        String nome = dbRs.getString("nome");
        String descricao = StringConverter.fromDataBaseNotation(dbRs.getString("descricao"));
        boolean desativada = dbRs.getBoolean("desativada");

        // Instancia o objeto
        Disciplina obj = new Disciplina(cod, nome, descricao, desativada);

        // Coloca-o na lista de objetos
        listaObj.addElement(obj);
      }

      listaObj.trimToSize();

      // Finaliza conexao
      dbStmt.close();
      dbCon.close();
    }
  }
  @WebMethod
  public List<Asset> getAsetByJenis(String jenis) throws SQLException {
    String query = "SELECT * FROM " + ASSET_TABLE + " WHERE jenis= '" + jenis + "'";
    ResultSet rs = executeQuery(query);

    List<Asset> assets = null;
    while (rs.next()) {
      if (rs.isFirst()) assets = new ArrayList<Asset>();
      Asset asset = new Asset();
      asset.setId(rs.getInt("id"));
      asset.setNama(rs.getString("nama"));
      asset.setKategori(rs.getString("kategori"));
      asset.setKategori(rs.getString("jenis"));
      asset.setTanggalMasuk(rs.getDate("tanggal_masuk"));
      asset.setKondisi(AssetCondition.getInstance(rs.getString("kondisi")));
      asset.setPemilik(rs.getString("pemilik"));
      asset.setVendor(getVendorAset(rs.getInt("id_vendor")));
      asset.setHarga(rs.getString("harga"));
      asset.setPublicAsset(rs.getBoolean("is_public"));
      assets.add(asset);
    }

    return assets;
  }
  /* Clear all existing nodes from the tree model and rebuild from scratch.
   */
  protected void refreshTree() {

    DefaultMutableTreeNode propertiesNode;
    DefaultMutableTreeNode leaf;

    // First clear the existing tree by simply enumerating
    // over the root node's children and removing them one by one.
    while (treeModel.getChildCount(rootNode) > 0) {
      DefaultMutableTreeNode child = (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

      treeModel.removeNodeFromParent(child);
      child.removeAllChildren();
      child.removeFromParent();
    }

    treeModel.nodeStructureChanged(rootNode);
    treeModel.reload();
    tScrollPane.repaint();

    // Now rebuild the tree below its root
    try {

      // Start by naming the root node from its URL:
      rootNode.setUserObject(dMeta.getURL());

      // get metadata about user tables by building a vector of table names
      String usertables[] = {"TABLE", "GLOBAL TEMPORARY", "VIEW"};
      ResultSet result = dMeta.getTables(null, null, null, usertables);
      Vector tables = new Vector();

      // sqlbob@users Added remarks.
      Vector remarks = new Vector();

      while (result.next()) {
        tables.addElement(result.getString(3));
        remarks.addElement(result.getString(5));
      }

      result.close();

      // For each table, build a tree node with interesting info
      for (int i = 0; i < tables.size(); i++) {
        String name = (String) tables.elementAt(i);
        DefaultMutableTreeNode tableNode = makeNode(name, rootNode);
        ResultSet col = dMeta.getColumns(null, null, name, null);

        // sqlbob@users Added remarks.
        String remark = (String) remarks.elementAt(i);

        if ((remark != null) && !remark.trim().equals("")) {
          makeNode(remark, tableNode);
        }

        // With a child for each column containing pertinent attributes
        while (col.next()) {
          String c = col.getString(4);
          DefaultMutableTreeNode columnNode = makeNode(c, tableNode);
          String type = col.getString(6);

          makeNode("Type: " + type, columnNode);

          boolean nullable = col.getInt(11) != DatabaseMetaData.columnNoNulls;

          makeNode("Nullable: " + nullable, columnNode);
        }

        col.close();

        DefaultMutableTreeNode indexesNode = makeNode("Indices", tableNode);
        ResultSet ind = dMeta.getIndexInfo(null, null, name, false, false);
        String oldiname = null;

        // A child node to contain each index - and its attributes
        while (ind.next()) {
          DefaultMutableTreeNode indexNode = null;
          boolean nonunique = ind.getBoolean(4);
          String iname = ind.getString(6);

          if ((oldiname == null || !oldiname.equals(iname))) {
            indexNode = makeNode(iname, indexesNode);

            makeNode("Unique: " + !nonunique, indexNode);

            oldiname = iname;
          }

          // And the ordered column list for index components
          makeNode(ind.getString(9), indexNode);
        }

        ind.close();
      }

      // Finally - a little additional metadata on this connection
      propertiesNode = makeNode("Properties", rootNode);

      makeNode("User: "******"ReadOnly: " + cConn.isReadOnly(), propertiesNode);
      makeNode("AutoCommit: " + cConn.getAutoCommit(), propertiesNode);
      makeNode("Driver: " + dMeta.getDriverName(), propertiesNode);
      makeNode("Product: " + dMeta.getDatabaseProductName(), propertiesNode);
      makeNode("Version: " + dMeta.getDatabaseProductVersion(), propertiesNode);
    } catch (SQLException se) {
      propertiesNode = makeNode("Error getting metadata:", rootNode);

      makeNode(se.getMessage(), propertiesNode);
      makeNode(se.getSQLState(), propertiesNode);
    }

    treeModel.nodeStructureChanged(rootNode);
    treeModel.reload();
    tScrollPane.repaint();
  }
Exemplo n.º 20
0
  private void retriveTableColumns(Table table) throws SQLException {
    GLogger.trace("-------setColumns(" + table.getSqlName() + ")");

    List primaryKeys = getTablePrimaryKeys(table);
    table.setPrimaryKeyColumns(primaryKeys);

    // get the indices and unique columns
    List indices = new LinkedList();
    // maps index names to a list of columns in the index
    Map uniqueIndices = new HashMap();
    // maps column names to the index name.
    Map uniqueColumns = new HashMap();
    ResultSet indexRs = null;

    try {

      if (table.getOwnerSynonymName() != null) {
        indexRs =
            getMetaData()
                .getIndexInfo(
                    getCatalog(), table.getOwnerSynonymName(), table.getSqlName(), false, true);
      } else {
        indexRs =
            getMetaData().getIndexInfo(getCatalog(), getSchema(), table.getSqlName(), false, true);
      }
      while (indexRs.next()) {
        String columnName = indexRs.getString("COLUMN_NAME");
        if (columnName != null) {
          GLogger.trace("index:" + columnName);
          indices.add(columnName);
        }

        // now look for unique columns
        String indexName = indexRs.getString("INDEX_NAME");
        boolean nonUnique = indexRs.getBoolean("NON_UNIQUE");

        if (!nonUnique && columnName != null && indexName != null) {
          List l = (List) uniqueColumns.get(indexName);
          if (l == null) {
            l = new ArrayList();
            uniqueColumns.put(indexName, l);
          }
          l.add(columnName);
          uniqueIndices.put(columnName, indexName);
          GLogger.trace("unique:" + columnName + " (" + indexName + ")");
        }
      }
    } catch (Throwable t) {
      // Bug #604761 Oracle getIndexInfo() needs major grants
      // http://sourceforge.net/tracker/index.php?func=detail&aid=604761&group_id=36044&atid=415990
    } finally {
      dbHelper.close(indexRs, null);
    }

    List columns = getTableColumns(table, primaryKeys, indices, uniqueIndices, uniqueColumns);

    for (Iterator i = columns.iterator(); i.hasNext(); ) {
      Column column = (Column) i.next();
      table.addColumn(column);
    }

    // In case none of the columns were primary keys, issue a warning.
    if (primaryKeys.size() == 0) {
      GLogger.warn(
          "WARNING: The JDBC driver didn't report any primary key columns in "
              + table.getSqlName());
    }
  }
  protected void initIndexes(ConnectionProvider cp, String tbl) {
    if (cp != null)
      try {
        boolean unique;
        DatabaseMetaData dmd = cp.getDatabaseMetaData();
        String shortTableName;
        if (tbl == null) shortTableName = getName().getName();
        else shortTableName = tbl;

        ResultSet rs;
        //                    rs = dmd.getIndexInfo(cp.getConnection().getCatalog(),
        // dmd.getUserName().trim(), shortTableName, false, true);
        rs =
            dmd.getIndexInfo(
                cp.getConnection().getCatalog(), cp.getSchema(), shortTableName, false, true);

        String name, columnName;
        boolean unq;
        LinkedList idxs = new LinkedList();
        if (rs != null) {
          HashMap rset = new HashMap();
          String uniqueStr;
          while (rs.next()) {
            name = rs.getString("INDEX_NAME"); // NOI18N
            columnName = rs.getString("COLUMN_NAME"); // NOI18N
            if (columnName != null) columnName = columnName.trim();
            unq = rs.getBoolean("NON_UNIQUE"); // NOI18N
            // hack for PostgreSQL bug 3480: the driver returns quotes around quoted column names
            if (columnName != null
                && columnName.length() >= 2
                && columnName.startsWith("\"")
                && columnName.endsWith("\"")) { // NOI18N
              columnName = columnName.substring(1, columnName.length() - 1);
            }

            if (name == null) continue;
            else name = name.trim();

            if (unq) idxs.add(name + "." + columnName + ".false"); // NOI18N
            else idxs.add(name + "." + columnName + ".true"); // NOI18N
          }
          rs.close();
        }

        String info;
        int start, end;
        for (int i = 0; i < idxs.size(); i++) {
          info = idxs.get(i).toString();
          start = info.indexOf('.'); // NOI18N
          end = info.lastIndexOf('.'); // NOI18N
          name = info.substring(0, start);
          if ((info.substring(end + 1)).equals("true")) // NOI18N
          unique = true;
          else unique = false;

          if (indexes.find(DBIdentifier.create(name)) != null) continue;

          IndexElementImpl iei = new IndexElementImpl(this, name, unique);
          IndexElement[] ie = {new IndexElement(iei, (TableElement) element)};
          iei.initColumns(idxs);
          changeIndexes(ie, DBElement.Impl.ADD);
        }
      } catch (Exception exc) {
        if (Boolean.getBoolean("netbeans.debug.exceptions")) // NOI18N
        exc.printStackTrace();
      }
  }
  /** Method declaration */
  private void refreshTree() {

    tTree.removeAll();

    try {
      int color_table = Color.yellow.getRGB();
      int color_column = Color.orange.getRGB();
      int color_index = Color.red.getRGB();

      tTree.addRow("", dMeta.getURL(), "-", 0);

      String usertables[] = {"TABLE"};
      ResultSet result = dMeta.getTables(null, null, null, usertables);
      Vector tables = new Vector();

      // sqlbob@users Added remarks.
      Vector remarks = new Vector();

      while (result.next()) {
        tables.addElement(result.getString(3));
        remarks.addElement(result.getString(5));
      }

      result.close();

      for (int i = 0; i < tables.size(); i++) {
        String name = (String) tables.elementAt(i);
        String key = "tab-" + name + "-";

        tTree.addRow(key, name, "+", color_table);

        // sqlbob@users Added remarks.
        String remark = (String) remarks.elementAt(i);

        if ((remark != null) && !remark.trim().equals("")) {
          tTree.addRow(key + "r", " " + remark);
        }

        ResultSet col = dMeta.getColumns(null, null, name, null);

        while (col.next()) {
          String c = col.getString(4);
          String k1 = key + "col-" + c + "-";

          tTree.addRow(k1, c, "+", color_column);

          String type = col.getString(6);

          tTree.addRow(k1 + "t", "Type: " + type);

          boolean nullable = col.getInt(11) != DatabaseMetaData.columnNoNulls;

          tTree.addRow(k1 + "n", "Nullable: " + nullable);
        }

        col.close();
        tTree.addRow(key + "ind", "Indices", "+", 0);

        ResultSet ind = dMeta.getIndexInfo(null, null, name, false, false);
        String oldiname = null;

        while (ind.next()) {
          boolean nonunique = ind.getBoolean(4);
          String iname = ind.getString(6);
          String k2 = key + "ind-" + iname + "-";

          if ((oldiname == null || !oldiname.equals(iname))) {
            tTree.addRow(k2, iname, "+", color_index);
            tTree.addRow(k2 + "u", "Unique: " + !nonunique);

            oldiname = iname;
          }

          String c = ind.getString(9);

          tTree.addRow(k2 + "c-" + c + "-", c);
        }

        ind.close();
      }

      tTree.addRow("p", "Properties", "+", 0);
      tTree.addRow("pu", "User: "******"pr", "ReadOnly: " + cConn.isReadOnly());
      tTree.addRow("pa", "AutoCommit: " + cConn.getAutoCommit());
      tTree.addRow("pd", "Driver: " + dMeta.getDriverName());
      tTree.addRow("pp", "Product: " + dMeta.getDatabaseProductName());
      tTree.addRow("pv", "Version: " + dMeta.getDatabaseProductVersion());
    } catch (SQLException e) {
      tTree.addRow("", "Error getting metadata:", "-", 0);
      tTree.addRow("-", e.getMessage());
      tTree.addRow("-", e.getSQLState());
    }

    tTree.update();
  }
Exemplo n.º 23
0
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
      _jspx_resourceInjector =
          (org.glassfish.jsp.api.ResourceInjector)
              application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE html>\n");
      out.write("<html>\n");
      out.write("    <head>\n");
      out.write(
          "        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("        <title>Fine</title>\n");
      out.write("        <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">    \n");
      out.write("\n");
      out.write("    </head>\n");
      out.write("    <body style = \"background-image: url(lib2.jpg)\">         \n");
      out.write("    <center>\n");
      out.write("        <h1>Update Fines information</h1>\n");
      out.write("        <form name=\"Update\" action=\"Fines_upd.jsp\">\n");
      out.write("            <table border=\"0\" width=\"3\" cellspacing=\"2\">\n");
      out.write("                <thead>\n");
      out.write("                    <tr>\n");
      out.write("                        <th>Update Fines</th>\n");
      out.write("                        <th></th>\n");
      out.write("                    </tr>\n");
      out.write("                </thead>\n");
      out.write("                <tbody>\n");
      out.write("                    <tr>\n");
      out.write("                        <td>Update Fine table with todays Data</td>\n");
      out.write(
          "                        <td><input type=\"submit\" value=\"Update / View Fines\" name=\"SUBMIT\"/></td>\n");
      out.write("                    </tr>\n");
      out.write("                </tbody>\n");
      out.write("            </table>           \n");
      out.write("        </form>\n");
      out.write("        <h1>Check your Fines Here</h1>\n");
      out.write("        <form name=\"Fines\" action=\"Fines.jsp\">\n");
      out.write("            <table border=\"0\" width=\"3\" cellspacing=\"2\">\n");
      out.write("                <thead>\n");
      out.write("                    <tr>\n");
      out.write("                        <th>Get Fine Details</th>\n");
      out.write("                        <th></th>\n");
      out.write("                    </tr>\n");
      out.write("                </thead>\n");
      out.write("                <tbody>\n");
      out.write("                    <tr>\n");
      out.write("                        <td>Card No</td>\n");
      out.write(
          "                        <td><input type=\"text\" name=\"Card_no\" value=\"\"/></td>\n");
      out.write("                    </tr>\n");
      out.write("                    <tr>\n");
      out.write("                        <td></td>\n");
      out.write(
          "                        <td><input type=\"submit\" value=\"Get Fines\" name=\"SUBMIT\" /></td>\n");
      out.write("                    </tr>\n");
      out.write("                </tbody>\n");
      out.write("            </table>        \n");
      out.write("            ");

      Connection con = null;
      String[] selected_Checkboxes = request.getParameterValues("chk");
      PreparedStatement pst = null;
      ResultSet result = null;
      ResultSet resUpd = null;
      con =
          DriverManager.getConnection(
              "jdbc:mysql://localhost:3306/lbms_db?zeroDateTimeBehavior=convertToNull",
              "root",
              "admin12");
      String Card_no = request.getParameter("Card_no");
      String button = null;
      Date dt = new Date();
      SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
      String current_date = sdf.format(dt);
      if (Card_no != null && selected_Checkboxes == null) {
        String selSql =
            "SELECT  l.card_no, SUM(f.fine_amt) AS total_fine, f.paid  "
                + "FROM book_loans l, fines f  "
                + "WHERE l.loan_id = f.loan_id AND "
                + "l.card_no = "
                + Card_no
                + " "
                + "GROUP BY l.card_no";
        pst = con.prepareStatement(selSql);
        result = pst.executeQuery();
        String box = null;
        String paid;
        String pay;
        Boolean chk = false;
        out.println("<table>");
        pay = "<form action='Fines.jsp'>";
        out.println(pay);
        out.println("<tr>");
        out.println("<th>Card No</th>");
        out.println("<th>Fine_Amt</th>");
        out.println("<th>Paid OR Not</th>");
        out.println("</tr>");
        while (result.next()) {
          chk = true;
          paid = "No";
          if (result.getBoolean("f.paid")) {
            paid = "Yes";
          }

          out.println("<tr>");
          out.println(
              "<td>"
                  + result.getInt("l.card_no")
                  + "</td><td>"
                  + result.getString("total_fine")
                  + "</td><td>"
                  + paid
                  + "</td>");
          out.print("<td>");
          box = "<input name='chk' value=" + result.getInt("l.card_no") + " type='checkbox'>";
          out.print(box);
          out.print("</td>");
          out.print("</tr>");
        }

        if (chk == true) {
          out.println("<tr>");
          out.print("<td>");
          button = "<input type='submit' value='Pay Fine' name='Pay'>";
          out.print(button);
          out.print("</td>");
          out.println("</tr>");
        } else {

          out.write(
              "<dialog open> <font color = 'green'>No Fine information. You owe nothing! Thank You</font> </dialog>");
        }
        out.println("</form>");
        out.println("</table>");
      } else if (selected_Checkboxes != null) {
        String sqlLoan = null;
        ResultSet resultLoan = null;
        String sqlUpdFine = null;
        PreparedStatement pstUpd = null;
        String sqlBook = null;
        ResultSet rsltBook = null;
        char chkouts = 'N';

        int length_chk = selected_Checkboxes.length;
        for (int i = 0; i < length_chk; i++) {
          // Check whether the Book is returned before paying the fine.
          sqlBook =
              "SELECT COUNT(loan_id) AS no_chkouts FROM book_loans WHERE card_no = "
                  + selected_Checkboxes[i]
                  + " AND date_in = '0000-00-00' AND due_date < "
                  + current_date
                  + "";
          pst = con.prepareStatement(sqlBook);
          rsltBook = pst.executeQuery();
          while (rsltBook.next()) {
            if (rsltBook.getInt("no_chkouts") > 0) {
              chkouts = 'Y';
            }
          }
          if (chkouts == 'Y') {

            out.write(
                "<dialog open> <font color = 'red'>You have outstanding due checkouts!. Please return the books and then Pay the fine</font> </dialog>");
          }
          // Get the corresponding loan_Ids for each customer from Fines table

          sqlLoan =
              "SELECT loan_id FROM book_loans WHERE card_no = "
                  + selected_Checkboxes[i]
                  + " AND date_in IS NOT NULL AND due_date < date_in";
          pst = con.prepareStatement(sqlLoan);
          resultLoan = pst.executeQuery();
          while (resultLoan.next()) {
            sqlUpdFine =
                "UPDATE fines SET paid = true WHERE loan_id = " + resultLoan.getInt("loan_id") + "";
            pstUpd = con.prepareStatement(sqlUpdFine);
            pstUpd.executeUpdate();
            out.println("Payment Updated Successfully");
          }
        }
      }

      out.write("\n");
      out.write("        </form>        \n");
      out.write("    </center>\n");
      out.write("</body>\n");
      out.write("</html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0) out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
Exemplo n.º 24
0
  private void getChannelList() {
    Connection con = null;
    ChannelInfo ci;

    this.channel_data.clear();

    try {
      con = pool.getConnection(timeout);

      ResultSet rs;
      try (Statement s = con.createStatement()) {
        rs = s.executeQuery("SELECT * FROM `channels`");
        PreparedStatement s2;
        ResultSet rs2;
        while (rs.next()) {
          ci = new ChannelInfo(rs.getString("channel"));
          ci.setDefaultOptions();

          ci.setReactiveChatter(
              rs.getInt("reactive_chatter_level"), rs.getInt("chatter_name_multiplier"));

          ci.setRandomChatter(rs.getInt("random_chatter_level"));

          ci.setTwitterTimers(
              rs.getFloat("tweet_bucket_max"), rs.getFloat("tweet_bucket_charge_rate"));

          ci.setWarAutoMuzzle(rs.getBoolean("auto_muzzle_wars"));

          ci.velociraptorSightings = rs.getInt("velociraptor_sightings");
          ci.activeVelociraptors = rs.getInt("active_velociraptors");
          ci.deadVelociraptors = rs.getInt("dead_velociraptors");
          ci.killedVelociraptors = rs.getInt("killed_velociraptors");

          if (rs.getDate("last_sighting_date") != null) {
            long time = rs.getDate("last_sighting_date").getTime();
            ci.lastSighting = new java.util.Date(time);
          }

          s2 =
              con.prepareStatement(
                  "SELECT `setting`, `value` FROM `channel_chatter_settings` WHERE `channel` = ?");
          s2.setString(1, rs.getString("channel"));
          s2.executeQuery();

          rs2 = s2.getResultSet();
          while (rs2.next()) {
            ci.addChatterSetting(rs2.getString("setting"), rs2.getBoolean("value"));
          }

          s2.close();
          rs2.close();

          s2 =
              con.prepareStatement(
                  "SELECT `setting`, `value` FROM `channel_command_settings` WHERE `channel` = ?");
          s2.setString(1, rs.getString("channel"));
          s2.executeQuery();

          rs2 = s2.getResultSet();
          while (rs2.next()) {
            ci.addCommandSetting(rs2.getString("setting"), rs2.getBoolean("value"));
          }

          s2.close();
          rs2.close();

          s2 =
              con.prepareStatement(
                  "SELECT `account` FROM `channel_twitter_feeds` WHERE `channel` = ?");
          s2.setString(1, rs.getString("channel"));
          s2.executeQuery();

          rs2 = s2.getResultSet();
          while (rs2.next()) {
            ci.addTwitterAccount(rs2.getString("account"));
          }

          s2.close();
          rs2.close();

          this.channel_data.put(ci.channel, ci);

          this.saveChannelSettings(ci);
        }
      }
      rs.close();
    } catch (SQLException ex) {
      Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
      try {
        if (con != null) {
          con.close();
        }
      } catch (SQLException ex) {
        Logger.getLogger(DBAccess.class.getName()).log(Level.SEVERE, null, ex);
      }
    }
  }
  protected CFSecurityISOTimezoneBuff unpackISOTimezoneResultSetToBuff(ResultSet resultSet)
      throws SQLException {
    final String S_ProcName = "unpackISOTimezoneResultSetToBuff";
    int idxcol = 1;
    CFSecurityISOTimezoneBuff buff = schema.getFactoryISOTimezone().newBuff();
    {
      String colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedByUserId(null);
      } else {
        buff.setCreatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setCreatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setCreatedAt(null);
      } else {
        buff.setCreatedAt(CFDbTestPgSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedByUserId(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedByUserId(null);
      } else {
        buff.setUpdatedByUserId(UUID.fromString(colString));
      }
      idxcol++;

      colString = resultSet.getString(idxcol);
      if (resultSet.wasNull()) {
        buff.setUpdatedAt(null);
      } else if ((colString == null) || (colString.length() <= 0)) {
        buff.setUpdatedAt(null);
      } else {
        buff.setUpdatedAt(CFDbTestPgSqlSchema.convertTimestampString(colString));
      }
      idxcol++;
    }
    buff.setRequiredISOTimezoneId(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredIso8601(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredTZName(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredTZHourOffset(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredTZMinOffset(resultSet.getShort(idxcol));
    idxcol++;
    buff.setRequiredDescription(resultSet.getString(idxcol));
    idxcol++;
    buff.setRequiredVisible(resultSet.getBoolean(idxcol));
    idxcol++;

    buff.setRequiredRevision(resultSet.getInt(idxcol));
    return (buff);
  }