|
|||||||||
| 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 of the JChemProperties table informs JChem how to
The table has 3 columns:
prop_name
| Key column (stores the name of each property which is used as a unique key). |
prop_value.
| Basic value column (short values are stored here). |
prop_value_ext.
| Extended value column (large values are stored here). |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_PROPERTY_TABLE
The default name of the property table (JChemProperties). |
static java.lang.String |
MD_PROPERTY_PREFIX
|
static java.lang.String |
NAME_COLUMN
The name of the key column (prop_name). |
static java.lang.String |
PROP_READONLY_DATABASE_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(ConnectionHandler conh)
Deprecated. in JChem 5.8 Please use DatabaseProperties(ConnectionHandler, boolean) instead.
The constructor DatabaseProperties(conh) is equivalent to DatabaseProperties(conh, false). |
|
DatabaseProperties(ConnectionHandler conh,
boolean indexTable)
Constructs an instance for use with JChem structure tables or 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 into the JChemProperties table. |
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 |
deleteMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName)
Removes MD table property from the JChemProperties table. |
void |
deleteProperty(java.lang.String name)
Removes the row with the specified key from the JChemProperties table,
if it exists. |
void |
deleteTableProperties(java.lang.String tableName)
Removes all table properties related to the given structure table from the JChemProperties table. |
void |
deleteTableProperty(java.lang.String tableName,
java.lang.String propName)
Removes a table property from the JChemProperties table. |
java.lang.StringBuilder |
getAllProperties()
Returns all properties in the JChem property table. |
java.lang.String |
getCacheRegistrationTableName()
Get the cache registration table name of the currently used property table. |
static java.lang.String |
getCacheRegistrationTableName(ConnectionHandler conh)
Get the table name containing the registration information |
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. |
java.lang.String[] |
getFingerprintParams(java.lang.String tableName)
Return the fingerprint parameters of a table. |
int |
getIntProperty(java.lang.String name)
Searches for the property with the specified key in the JChemProperties table. |
java.lang.String[] |
getMDConfigs(java.lang.String tableName,
java.lang.String descriptorName)
Retrieves the names of stored configurations associated with a certain Molecular Descriptor. |
java.lang.String |
getMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName)
Gets MD table property from the JChemProperties table. |
java.lang.String[] |
getMolecularDescriptors(java.lang.String tableName)
Retrieves the names of MolecularDescriptors assigned to the structure table and stored in the JChem database. |
java.lang.String |
getProperty(java.lang.String name)
Searches for the property with the specified key in the JChemProperties table. |
java.util.Vector<java.lang.String> |
getStructureTableNames()
Returns the names of structure tables registered in the JChemProperties table. |
int |
getTableIntProperty(java.lang.String tableName,
java.lang.String propName)
Gets an integer table property from the JChemProperties table. |
java.util.Map<java.lang.String,java.lang.String> |
getTableProperties(java.lang.String tableName)
Return all properties for a table. |
java.lang.String |
getTableProperty(java.lang.String tableName,
java.lang.String propName)
Gets a table property from the JChemProperties table. |
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 |
isChemTermColumnDefined()
Retrieve whether at least one Chemical Term column is defined for any table or not. |
boolean |
isDatabaseReadonly()
Returns whether database of the current JChem property table is readonly. |
boolean |
isDuplicateFilteringOption(java.lang.String tableName)
Returns the state of the Duplicate Filtering table option. |
boolean |
isGenericTautomerProtectsChirality(java.lang.String tableName)
Returns whether generic tautomer protects chirality in tautomer region. |
boolean |
isMolecularDescriptorDefined()
Retrieve whether at least one MolecularDescriptor is defined for any table or not. |
boolean |
isSetSwitchOffAllProtectionsForTDF(java.lang.String tableName)
Returns whether all protections for tautomer duplicate filtering is switched off. |
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 |
setAbsoluteStereoOption(java.lang.String tableName,
boolean value)
Sets the Absolute stereo table property with the specified value in the JChemProperties table. |
java.lang.String |
setCacheRegistrationTableName()
Set the name of the cache registration table for the current property table. |
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 |
setDuplicateFilteringOption(java.lang.String tableName,
boolean value)
Sets the Duplicate filtering table property with the specified value in the JChemProperties table. |
void |
setMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName,
java.lang.String propValue)
Sets the given MD table property in the JChemProperties table. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets the property with the specified key and value in the JChemProperties table. |
void |
setStandardizerConfigOption(java.lang.String tableName,
java.lang.String value)
Sets the standardizer configuration table property to the specified value in the JChemProperties table. |
void |
setTableProperty(java.lang.String tableName,
java.lang.String propName,
java.lang.String propValue)
Sets the given table property in the JChemProperties table. |
void |
setTautomerDuplicateFilteringOption(java.lang.String tableName,
boolean value)
Sets the Tautomer duplicate checking table property with the specified 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 final 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
public static final java.lang.String MD_PROPERTY_PREFIX
public static final java.lang.String PROP_READONLY_DATABASE_NAME
| Constructor Detail |
|---|
@Deprecated
public DatabaseProperties(ConnectionHandler conh)
throws java.sql.SQLException
DatabaseProperties(ConnectionHandler, boolean) instead.
The constructor DatabaseProperties(conh) is equivalent to DatabaseProperties(conh, false).
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 in case of JChem structure tables.
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.
java.lang.NumberFormatException - if the property value cannot be parsed as an integer
java.sql.SQLException
public void addProperty(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 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 void setDuplicateFilteringOption(java.lang.String tableName,
boolean 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.
tableName - Name of the structure table.value - The duplicate filtering property value.
java.sql.SQLException
public void setAbsoluteStereoOption(java.lang.String tableName,
boolean 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.
tableName - Name of the structure table.value - The absolute stereo property value.
java.sql.SQLException
public void setTautomerDuplicateFilteringOption(java.lang.String tableName,
boolean 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.
tableName - Name of the structure table.value - The tautomer duplicate checking property value.
java.sql.SQLException
public void setStandardizerConfigOption(java.lang.String tableName,
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.
tableName - Name of the structure table.value - The standardizer configuration string.
java.sql.SQLException
public void setTableProperty(java.lang.String tableName,
java.lang.String propName,
java.lang.String propValue)
throws java.sql.SQLException
JChemProperties table.
If the property exists with the specified name, then it is updated,
otherwise a new row is inserted.
tableName - Name of the structure table.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
java.sql.SQLException
public java.lang.String getTableProperty(java.lang.String tableName,
java.lang.String propName)
throws java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
JChemProperties table, null otherwise.
java.sql.SQLException
public int getTableIntProperty(java.lang.String tableName,
java.lang.String propName)
throws java.lang.IllegalArgumentException,
java.lang.NumberFormatException,
java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
JChemProperties table and can be parsed to int.
java.lang.IllegalArgumentException - if the given property is not found.
java.lang.NumberFormatException - if the given property cannot be parsed to int.
java.sql.SQLException
public void deleteTableProperty(java.lang.String tableName,
java.lang.String propName)
throws java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
java.sql.SQLException
public void deleteTableProperties(java.lang.String tableName)
throws java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.
java.sql.SQLException
public void setMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName,
java.lang.String propValue)
throws java.sql.SQLException
JChemProperties table.
If the property exists with the specified name, then it is updated,
otherwise a new row is inserted.
tableName - Name of the structure table.descrName - Name of the descriptor.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
java.sql.SQLException
public java.lang.String getMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName)
throws java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.descrName - Name of the descriptor.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
JChemProperties table, null otherwise.
java.sql.SQLException
public void deleteMDTableProperty(java.lang.String tableName,
java.lang.String descrName,
java.lang.String propName)
throws java.sql.SQLException
JChemProperties table.
tableName - Name of the structure table.descrName - Name of the descriptor.propName - Name of the property. It is case sensitive,
e.g. "JChemVersion" is not the same as "jchemVersion".
Use the constans defined in PropertyConstants.Table.
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:
java.sql.SQLExceptioncreatePropertyTable(chemaxon.util.ConnectionHandler)
public java.util.Vector<java.lang.String> getStructureTableNames()
throws java.sql.SQLException
JChemProperties table.
java.sql.SQLException
public java.lang.String[] getMolecularDescriptors(java.lang.String tableName)
throws java.sql.SQLException
tableName - the name of the structure table
java.sql.SQLException
public boolean isMolecularDescriptorDefined()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String[] getMDConfigs(java.lang.String tableName,
java.lang.String descriptorName)
throws java.sql.SQLException
tableName - the name of the structure tabledescriptorName - the name of the molecular descriptor
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 boolean isChemTermColumnDefined()
throws java.sql.SQLException
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 java.lang.String setCacheRegistrationTableName()
throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getCacheRegistrationTableName()
throws java.sql.SQLException
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 boolean isGenericTautomerProtectsChirality(java.lang.String tableName)
throws java.sql.SQLException
tableName - the name of the JChem structure table
true if generic tautomer protects chirality
java.sql.SQLException
public boolean isSetSwitchOffAllProtectionsForTDF(java.lang.String tableName)
throws java.sql.SQLException
tableName - the name of the JChem structure table
true if all protects are switched off
java.sql.SQLException
public boolean isDatabaseReadonly()
throws java.sql.SQLException
true if the database is readonly
java.sql.SQLException
public void close()
throws java.sql.SQLException
setUsePreparedStatement(boolean).
java.sql.SQLException
public java.lang.String[] getFingerprintParams(java.lang.String tableName)
throws java.sql.SQLException
tableName -
java.sql.SQLException
public java.util.Map<java.lang.String,java.lang.String> getTableProperties(java.lang.String tableName)
throws java.sql.SQLException
tableName - Name of the structure table
java.sql.SQLException
public boolean isDuplicateFilteringOption(java.lang.String tableName)
throws java.sql.SQLException
tableName - Name of the structure table
java.sql.SQLException
public java.lang.StringBuilder getAllProperties()
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getCacheRegistrationTableName(ConnectionHandler conh)
throws java.sql.SQLException
conh - ConnectionHandler to use
java.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||