package search;
import java.sql.SQLException;
import chemaxon.jchem.db.StructureTableOptions;
import chemaxon.jchem.db.TableTypeConstants;
import chemaxon.jchem.db.UpdateHandler;
import chemaxon.util.ConnectionHandler;
@author
@author
@version
public class TableOperations {
@param
@param
@throws
public static void createDatabaseTable(ConnectionHandler connectionHandler,
String structTableName)
throws SQLException {
createDatabaseTable(connectionHandler, structTableName,
TableTypeConstants.TABLE_TYPE_DEFAULT);
}
@param
@param
@param
@throws
public static void createDatabaseTable(ConnectionHandler connectionHandler,
String structTableName, int tableType)
throws SQLException {
try {
UpdateHandler.dropStructureTable(connectionHandler,
structTableName);
} catch (SQLException sqlException) {
}
StructureTableOptions tableOptions = new StructureTableOptions();
tableOptions.name = structTableName;
tableOptions.tableType = tableType;
tableOptions.fp_numberOfInts =
UpdateHandler.FP_DEFAULT_LENGTH_IN_INTS[tableType];
tableOptions.fp_numberOfOnes =
UpdateHandler.FP_DEFAULT_BITS_PER_PATTERN[tableType];
tableOptions.fp_numberOfEdges =
UpdateHandler.FP_DEFAULT_PATTERN_LENGTH[tableType];
UpdateHandler.createStructureTable(connectionHandler, tableOptions);
}
}