Package org.biojava.bio.seq.db.biosql
Class DBHelper
- java.lang.Object
-
- org.biojava.bio.seq.db.biosql.DBHelper
-
- Direct Known Subclasses:
HypersonicDBHelper,MySQLDBHelper,OracleDBHelper,PostgreSQLDBHelper,UnknownDBHelper
public abstract class DBHelper extends Object
Deprecated.Use hibernate and org.biojavax.bio.db.*Isolates all code that is specific to a particular RDBMS. To add support for a new RDBMS, write a newDBHelpersubclass and ensure that it can be found by editing thegetDBHelperForURLmethod in this class.- Author:
- Thomas Down, Matthew Pocock, Len Trigg, Eric Haugen, Richard Holland
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDBHelper.BioSequenceStyleDeprecated.static classDBHelper.DeleteStyleDeprecated.static classDBHelper.JoinStyleDeprecated.
-
Field Summary
Fields Modifier and Type Field Description static DBHelper.BioSequenceStyleBIOSEQUENCE_GENERICDeprecated.static DBHelper.BioSequenceStyleBIOSEQUENCE_ORACLECLOBDeprecated.static DBHelper.DeleteStyleDELETE_GENERICDeprecated.static DBHelper.DeleteStyleDELETE_MYSQL4Deprecated.static DBHelper.DeleteStyleDELETE_POSTGRESQLDeprecated.static DBHelper.JoinStyleJOIN_GENERICDeprecated.static DBHelper.JoinStyleJOIN_ORACLE8Deprecated.
-
Constructor Summary
Constructors Constructor Description DBHelper()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancontainsTable(DataSource ds, String tablename)Deprecated.Detects whether a particular table is present in the database.DBHelper.BioSequenceStylegetBioSequenceStyle()Deprecated.Returns the an object indicating the style of biosequence storage that this database should employ.static DBHelpergetDBHelper(Connection conn)Deprecated.Returns a DBHelper implementation suitable for a particular database.DBHelper.DeleteStylegetDeleteStyle()Deprecated.Returns the an object indicating the style of deletion that this database should employ.abstract intgetInsertID(Connection conn, String table, String columnName)Deprecated.Returns the id value created during the last insert command.DBHelper.JoinStylegetJoinStyle()Deprecated.Returns the an object indicating the style of table joining that this database should employ.
-
-
-
Field Detail
-
DELETE_POSTGRESQL
public static final DBHelper.DeleteStyle DELETE_POSTGRESQL
Deprecated.
-
DELETE_MYSQL4
public static final DBHelper.DeleteStyle DELETE_MYSQL4
Deprecated.
-
DELETE_GENERIC
public static final DBHelper.DeleteStyle DELETE_GENERIC
Deprecated.
-
JOIN_ORACLE8
public static final DBHelper.JoinStyle JOIN_ORACLE8
Deprecated.
-
JOIN_GENERIC
public static final DBHelper.JoinStyle JOIN_GENERIC
Deprecated.
-
BIOSEQUENCE_GENERIC
public static final DBHelper.BioSequenceStyle BIOSEQUENCE_GENERIC
Deprecated.
-
BIOSEQUENCE_ORACLECLOB
public static final DBHelper.BioSequenceStyle BIOSEQUENCE_ORACLECLOB
Deprecated.
-
-
Constructor Detail
-
DBHelper
public DBHelper()
Deprecated.
-
-
Method Detail
-
getDBHelper
public static DBHelper getDBHelper(Connection conn)
Deprecated.Returns a DBHelper implementation suitable for a particular database.- Parameters:
conn- a connection to the database.- Returns:
- a
DBHelper.
-
getInsertID
public abstract int getInsertID(Connection conn, String table, String columnName) throws SQLException
Deprecated.Returns the id value created during the last insert command. This is for tables that have an auto increment column.- Returns:
- the last id assigned, or -1 if the id could not be found.
- Throws:
SQLException
-
getDeleteStyle
public DBHelper.DeleteStyle getDeleteStyle()
Deprecated.Returns the an object indicating the style of deletion that this database should employ. Unless overridden, this is DELETE_GENERIC.- Returns:
- the preferred deletion style.
-
getJoinStyle
public DBHelper.JoinStyle getJoinStyle()
Deprecated.Returns the an object indicating the style of table joining that this database should employ.- Returns:
- the preferred joining style.
-
getBioSequenceStyle
public DBHelper.BioSequenceStyle getBioSequenceStyle()
Deprecated.Returns the an object indicating the style of biosequence storage that this database should employ. Generally, leave it at the default unless you are using the Oracle schema, in which case you need to override it to return BIOSEQUENCE_ORACLECLOB. This is because, in the Oracle schema we need to use CLOBs (except when using Len Trigg's version which uses LONGs instead.)- Returns:
- the preferred joining style.
-
containsTable
public boolean containsTable(DataSource ds, String tablename)
Deprecated.Detects whether a particular table is present in the database.- Parameters:
ds- aDataSourcethat can provide a connection to a databasetablename- the name of the table.- Returns:
- true if the table exists in the database.
- Throws:
NullPointerException- if pool is null.IllegalArgumentException- if tablename is null or empty.
-
-