|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.jchem.db.DatabaseProperties
public class DatabaseProperties
Methods for reading and writing the JChemProperties table that contains information about the database and the structure tables. The content the JChemProperties table informs JChem how to
name
| Keys that are used to access the value. |
value.
| The value of the property. |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_PROPERTY_TABLE
The default name of the property table (JChemProperties). |
static java.lang.String |
NAME_COLUMN
The name of the key column (prop_name). |
static java.lang.String |
VALUE_COLUMN
The name of the value column (prop_value). |
static java.lang.String |
VALUE_COLUMN_EXT
The name of the value column extension (prop_value_ext). |
| Constructor Summary | |
|---|---|
DatabaseProperties(java.sql.Connection con)
Deprecated. Use DatabaseProperties(ConnectionHandler) instead. |
|
DatabaseProperties(ConnectionHandler conh)
Constructs an instance for use with JChem structure tables. |
|
DatabaseProperties(ConnectionHandler conh,
boolean indexTable)
Used internally for use with JChem Cartridge index tables. |
|
| Method Summary | |
|---|---|
void |
addProperty(java.lang.String name,
java.lang.String value)
Inserts the property with the specified key and value If the specified value is null, the property is deleted. |
void |
close()
Should be called only if the use of prepared statements are enabled with setUsePreparedStatement(boolean). |
static void |
createPropertyTable(ConnectionHandler conh)
Creates a new property table for storing JChem's settings. |
static void |
createPropertyTable(ConnectionHandler conh,
int mySqlTableType)
Creates a new property table for storing JChem's settings. |
void |
deleteChemTermForColumn(java.lang.String tableName,
java.lang.String columnName)
Deletes the property defining the Chemical Terms expression that should be used to compute the value for the given column. |
void |
deleteProperty(java.lang.String name)
Removes the row with the specified key from the JChemProperties table,
if it exists. |
java.lang.String[] |
getChemTermColumns(java.lang.String tableName)
Returns the name of columns with values automatically calculated based on Chemical Terms expressions. |
java.lang.String |
getChemTermForColumn(java.lang.String tableName,
java.lang.String columnName)
Gets the Chemical Terms expression that should be used to compute the value for the given column. |
int |
getIntProperty(java.lang.String name)
Searches for the property with the specified key in the JChemProperties table. |
java.lang.String |
getProperty(java.lang.String name)
Searches for the property with the specified key in the JChemProperties table. |
java.util.Vector |
getStructureTableNames()
Returns the names of structure tables registered in the JChemProperties table. |
java.util.Vector |
getStructureTableNames(boolean indexTables)
Deprecated. Use getStructureTableNames() in conjunction with
DatabaseProperties(ConnectionHandler, boolean) to
indicate whether the names of JChem structure tables or JChem
Cartridge index tables are to be retrieved. |
java.lang.String[] |
getSynthesisStructureTableNames()
Retrieves the names of structure tables belonging to stored synthesises |
int |
getTableType(java.lang.String tableName)
Returns the type of the specified table. |
long |
incrementProperty(java.lang.String name)
Increments the value of property with the specified key by one. |
boolean |
isTautomerDuplicateFilteringEnabled(java.lang.String tableName)
Returns whether tautomers are considered during duplicate filtering for this table. |
boolean |
isUsePreparedStatement()
|
static boolean |
propertyTableExists(ConnectionHandler conh)
Checks if JChem property table exists. |
void |
setChemTermForColumn(java.lang.String tableName,
java.lang.String columnName,
java.lang.String expression)
Sets the Chemical Terms expression that should be used to compute the value for the given column. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets the property with the specified key and value in the JChemProperties table. |
void |
setUsePreparedStatement(boolean usePreparedStatement)
Specifies if PreparedStatement should be used for property lookup. |
void |
updateProperty(java.lang.String name,
java.lang.String value)
Updates the property with the specified key and value in the JChemProperties table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String DEFAULT_PROPERTY_TABLE
public static final java.lang.String NAME_COLUMN
public static final java.lang.String VALUE_COLUMN
public static final java.lang.String VALUE_COLUMN_EXT
| Constructor Detail |
|---|
public DatabaseProperties(java.sql.Connection con)
throws java.sql.SQLException
DatabaseProperties(ConnectionHandler) instead.
con - the JDBC connection.
java.sql.SQLException
public DatabaseProperties(ConnectionHandler conh)
throws java.sql.SQLException
conh - the
ConnectionHandler
object that contains at least a valid JDBC connection and property table name.
java.sql.SQLException
public DatabaseProperties(ConnectionHandler conh,
boolean indexTable)
throws java.sql.SQLException
conh - the ConnectionHandler object that
contains at least a valid JDBC connection and property
table name.indexTable - true if this instance is to be used with JChem Cartridge
index tables, false other wise.
java.sql.SQLException| Method Detail |
|---|
public java.lang.String getProperty(java.lang.String name)
throws java.sql.SQLException
JChemProperties table.
If value is null, retruns the extended value.
name - the property key.
null if the property doesn't exist.
java.sql.SQLException
public int getIntProperty(java.lang.String name)
throws java.sql.SQLException
JChemProperties table.
name - the property key.
int, or Integer.MINVALUE,
if not found in the table or cannot be parsed as a number
java.lang.NullPointerException - if the property
doesn't exist
java.sql.SQLException
public void addProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
null, the property is deleted.
into the JChemProperties table.
name - the property key.value - the property value. If null, the property
is deleted.
java.sql.SQLException
public void updateProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
JChemProperties table.
If the specified value is null, the property is deleted.
name - the property key.value - the property value. If null, the property
is deleted.
java.sql.SQLException
public void setProperty(java.lang.String name,
java.lang.String value)
throws java.sql.SQLException
JChemProperties table.
If the property exists with the specified name,
then it is updated, otherwise
a new row is inserted.
If the specified value is null, the property is deleted.
name - the property key.value - the property value. If null, the property
is deleted.
java.sql.SQLException
public long incrementProperty(java.lang.String name)
throws java.sql.SQLException
name - the property key.
java.sql.SQLException
public void deleteProperty(java.lang.String name)
throws java.sql.SQLException
JChemProperties table,
if it exists.
name - the property key.
java.sql.SQLExceptionpublic static boolean propertyTableExists(ConnectionHandler conh)
conh - must contain at minimum a live connection and a property
table name
public static void createPropertyTable(ConnectionHandler conh)
throws java.sql.SQLException
propertyTableExists
conh - it should contain at minimum a live connection and a property
table name
If your database server type is MySql, recommend to use the other
createPropertyTable method
java.sql.SQLExceptioncreatePropertyTable(ConnectionHandler, int)
public static void createPropertyTable(ConnectionHandler conh,
int mySqlTableType)
throws java.sql.SQLException
propertyTableExists
conh - it should contain at minimum a live connection and a property
table namemySqlTableType - table type for MySQL, for other RDBMS ignored.
Accepted values:
TableTypeConstants.MYSQL_DEFAULT_TABLE_TYPETableTypeConstants.MYSQL_FORCE_INNO_DBTableTypeConstants.MYSQL_FORCE_MYISAMjava.sql.SQLExceptioncreatePropertyTable(chemaxon.util.ConnectionHandler)
public java.util.Vector getStructureTableNames()
throws java.sql.SQLException
JChemProperties table.
java.sql.SQLException
public java.util.Vector getStructureTableNames(boolean indexTables)
throws java.sql.SQLException
getStructureTableNames() in conjunction with
DatabaseProperties(ConnectionHandler, boolean) to
indicate whether the names of JChem structure tables or JChem
Cartridge index tables are to be retrieved.
JChemProperties table.
indexTables - set to true to get the list of cartridge
index tables.
java.sql.SQLException
public java.lang.String[] getSynthesisStructureTableNames()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isUsePreparedStatement()
public void setUsePreparedStatement(boolean usePreparedStatement)
close() should be called after usage.
usePreparedStatement - set to true to use preapared
statements for reading data. Default is false
public java.lang.String[] getChemTermColumns(java.lang.String tableName)
throws java.sql.SQLException
tableName - the table, the Chemical Terms-based columns of which should be
returned.
java.sql.SQLException
public void setChemTermForColumn(java.lang.String tableName,
java.lang.String columnName,
java.lang.String expression)
throws java.sql.SQLException
tableName - name of the table containing the columncolumnName - name fo the column with pre-computed Chemical Terms values.expression - the Chemical Terms expression that should be used to compute
the value for the given column.
java.sql.SQLException
public java.lang.String getChemTermForColumn(java.lang.String tableName,
java.lang.String columnName)
throws java.sql.SQLException
tableName - name of the table containing the columncolumnName - name fo the column with pre-computed Chemical Terms values.
java.sql.SQLException
public void deleteChemTermForColumn(java.lang.String tableName,
java.lang.String columnName)
throws java.sql.SQLException
tableName - name of the table containing the columncolumnName - name fo the column with pre-computed Chemical Terms
values.
java.sql.SQLException
public int getTableType(java.lang.String tableName)
throws java.sql.SQLException
tableName - the name of the JChem structure table
java.sql.SQLException
public boolean isTautomerDuplicateFilteringEnabled(java.lang.String tableName)
throws java.sql.SQLException
tableName - the name of the JChem structure table
true if tautomer duplicate filtering is enabled
for the table
java.sql.SQLException
public void close()
throws java.sql.SQLException
setUsePreparedStatement(boolean).
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||