Database

abc.

Database access using the Java Database Connection (JDBC)

For the database access presented here the properties location, password, username, driver must be set in the joelib.properties-file. Additionally this example will create MOLECULES table with the table properties

Table 9-1. Simple database definition

NameData typeDescription
NAMEVARCHAR(100)Molecule name
IDBIGINTMolecule identifieer, should be unique
HASHBIGINTHashcode for the molecule (checking for duplicates, until now without cis/trans, E/Z)
SHASHBIGINTHashcode for the molecule using SMILES (checking for duplicates, including cis/trans, E/Z)
SDFLONGTEXTStructured Data File (SDF)
CMLLONGTEXTChemical Markup Language (CML)
SMILESLONGTEXTSimplified Molecular Input Line Entry System (SMILES)

Example 9-29. Database access

public static void main(String[] args)
{
  SimpleJOELibDatabase dbTest = new SimpleJOELibDatabase();

  logger.info("Open file:" + args[0]);
  logger.info("with input type:" + args[1]);

  dbTest.storeMolsInDatabase(args[0],IOTypeHolder.instance().getIOType(args[1]));
}