Package org.bridgedb.rdb
Class SimpleGdb
- java.lang.Object
-
- org.bridgedb.rdb.IDMapperRdb
-
- org.bridgedb.rdb.SimpleGdb
-
- All Implemented Interfaces:
AttributeMapper,IDMapper,XrefIterator
- Direct Known Subclasses:
SimpleGdbImplCommon
public abstract class SimpleGdb extends IDMapperRdb
SimpleGdb is the main implementation of the Gdb interface, for dealing with single SQL-based pgdb's. It's responsible for creating and querying a single pgdb relational database through the JDBC interface.It wraps SQL statements in methods, so the rest of the apps don't need to know the details of the Database schema.
It delegates dealing with the differences between various RDBMS's (Derby, Hsqldb etc.) to a DBConnector instance. A correct DBConnector instance needs to be passed to the constructor of SimpleGdb.
In the PathVisio GUI environment, use GdbManager to create and connect one or two centralized Gdb's. This will also automatically find the right DBConnector from the preferences.
In a head-less or test environment, you can bypass GdbManager and use SimpleGdb directly to create or connect to one or more pgdb's of any type.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdbNamestatic intNO_LIMITstatic intNO_TIMEOUTstatic intQUERY_TIMEOUT-
Fields inherited from interface org.bridgedb.AttributeMapper
MATCH_ID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ConnectiongetConnection()StringgetDbName()Gets the name of te currently used gene database.intgetGeneCount()intgetGeneCount(DataSource ds)intgetLinkCount()booleanisConnected()-
Methods inherited from class org.bridgedb.rdb.IDMapperRdb
mapID, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.bridgedb.AttributeMapper
freeAttributeSearch, freeAttributeSearchEx, getAttributes, getAttributes, getAttributeSet, isFreeAttributeSearchSupported
-
Methods inherited from interface org.bridgedb.IDMapper
freeSearch, getCapabilities, mapID, xrefExists
-
Methods inherited from interface org.bridgedb.XrefIterator
getIterator, getIterator
-
-
-
-
Field Detail
-
dbName
protected final String dbName
-
NO_LIMIT
public static final int NO_LIMIT
- See Also:
- Constant Field Values
-
NO_TIMEOUT
public static final int NO_TIMEOUT
- See Also:
- Constant Field Values
-
QUERY_TIMEOUT
public static final int QUERY_TIMEOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConnection
public Connection getConnection() throws SQLException
- Throws:
SQLException
-
isConnected
public final boolean isConnected()
-
getDbName
public final String getDbName()
Gets the name of te currently used gene database.- Specified by:
getDbNamein classIDMapperRdb- Returns:
- the database name as specified in the connection string
-
close
public final void close() throws IDMapperException- Throws:
IDMapperException
-
getGeneCount
public final int getGeneCount() throws IDMapperException- Returns:
- number of rows in gene table.
- Throws:
IDMapperException- on failure
-
getLinkCount
public final int getLinkCount() throws IDMapperException- Returns:
- number of rows in link table.
- Throws:
IDMapperException- on failure
-
getGeneCount
public final int getGeneCount(DataSource ds) throws IDMapperException
- Parameters:
ds- DataSource to count identifiers for.- Returns:
- number of identifiers table for the given datasource
- Throws:
IDMapperException- on failure
-
-