User 2793f13b08
23-08-2007 20:15:08
Pardon the silly question but...
Is there a method that will get me that CD_ID value? Is it because the CD_ID is an index that I cannot retrieve it?
DatabaseTools only has readString and readBytes. How do I handle Integer field types? This code give me an exception as follows:
Also, could you direct me to the API which has the description of the field types? I'd like to know what the numbers mean...
Thank you and sorry if this has been answered before. A quick search in the forum didn't get me any answers.
Omar
Code: |
PreparedStatement pstmt = c.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); if (rs.next()) { System.out.println("ID: "+byteArrayToInt((DatabaseTools.readBytes(rs, 1)))); } |
Is there a method that will get me that CD_ID value? Is it because the CD_ID is an index that I cannot retrieve it?
DatabaseTools only has readString and readBytes. How do I handle Integer field types? This code give me an exception as follows:
Code: |
Exception in thread "main" java.sql.SQLException: Cannot handle type in field "cd_id": java.lang.Integer at chemaxon.util.DatabaseTools.readBytesOrString(DatabaseTools.java:248) at chemaxon.util.DatabaseTools.readBytes(DatabaseTools.java:168) at chemaxon.util.DatabaseTools.readBytes(DatabaseTools.java:141) at ligandcalculations.CalculateLigandProperties.main(CalculateLigandProperties.java:96) |
Also, could you direct me to the API which has the description of the field types? I'd like to know what the numbers mean...
Quote: |
fieldName: CD_ID and type: 4 fieldName: CD_STRUCTURE and type: -4 fieldName: CD_SMILES and type: -1 fieldName: CD_LIGAND_ID and type: -1 fieldName: CD_FORMULA and type: 12 fieldName: CD_MOLWEIGHT and type: 8 fieldName: CD_HASH and type: 4 fieldName: CD_FLAGS and type: 12 fieldName: CD_TIMESTAMP and type: 93 |
Omar