chemaxon.descriptors
Class MDDBWriter

java.lang.Object
  extended by chemaxon.descriptors.MDWriter
      extended by chemaxon.descriptors.MDDBWriter

public class MDDBWriter
extends MDWriter

Class for inserting Molecular Descriptors into database tables.

Since:
JChem 2.0
Author:
Szilard Dorant

Field Summary
 
Fields inherited from class chemaxon.descriptors.MDWriter
mdNames
 
Constructor Summary
MDDBWriter()
           
 
Method Summary
 void close()
          Closes down the descriptor output stream.
 ConnectionHandler getConnectionHandler()
          Gets the ConnectionHandler object used to reach the database.
 java.lang.String[] getMDNames()
          Gets the names of the Molecular Descriptors in database
 MDParameters getMDParameters(int id)
          Gets the actual parameter settings of the specified component.
 java.lang.String getStructureTable()
          Gets the name of the structure table
 void put(Molecule mol, int id)
          Inserts descriptor data into the database
 void setConnectionHandler(ConnectionHandler ch)
          Sets the ConnectionHandler object used to reach the database.
 void setMDNames(java.lang.String[] mdNames)
          Sets the names of the Molecular Descriptors in database
 void setStructureTable(java.lang.String strucTableName)
          Sets the name of the structure table
 void setUpdateMode(boolean updateMode)
          Specifies whether new records will be added, or existing records updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MDDBWriter

public MDDBWriter()
Method Detail

setConnectionHandler

public void setConnectionHandler(ConnectionHandler ch)
Sets the ConnectionHandler object used to reach the database.

Parameters:
ch - the ConnectionHandler with an open connection to the database.

getConnectionHandler

public ConnectionHandler getConnectionHandler()
Gets the ConnectionHandler object used to reach the database.

Returns:
the ConnectionHandler

setStructureTable

public void setStructureTable(java.lang.String strucTableName)
Sets the name of the structure table

Parameters:
strucTableName - the name of the structure table

getStructureTable

public java.lang.String getStructureTable()
Gets the name of the structure table

Returns:
the name of the structure table

setMDNames

public void setMDNames(java.lang.String[] mdNames)
Sets the names of the Molecular Descriptors in database

Parameters:
mdNames - the name of the Molecular Descriptors

getMDNames

public java.lang.String[] getMDNames()
Gets the names of the Molecular Descriptors in database

Returns:
the name of the Molecular Descriptors

getMDParameters

public MDParameters getMDParameters(int id)
Gets the actual parameter settings of the specified component.

Specified by:
getMDParameters in class MDWriter
Parameters:
id - component index
Returns:
parameter settings
Since:
JChem 2.1

setUpdateMode

public void setUpdateMode(boolean updateMode)
Specifies whether new records will be added, or existing records updated.

Parameters:
updateMode - set to true for updateing existing rows.

put

public void put(Molecule mol,
                int id)
         throws chemaxon.descriptors.MDWriterException
Inserts descriptor data into the database

Specified by:
put in class MDWriter
Parameters:
mol - the molecule to generate descriptor data from
id - the cd_id of the table rows : should be the same, as in the structure table
Throws:
chemaxon.descriptors.MDWriterException - all exceptions (mainly io) are reinterpreted

close

public void close()
           throws chemaxon.descriptors.MDWriterException
Closes down the descriptor output stream. After this, no more operation is permitted on the stream. Calling close guarantees that all data put so far are permanently saved in the stream.
NOTE: Doesn't close the database connection specified in the ConnectionHandler.

Specified by:
close in class MDWriter
Throws:
chemaxon.descriptors.MDWriterException