public abstract class AbstractDBInterface extends java.lang.Object implements DBInterface
DBInterface.Transaction
Constructor and Description |
---|
AbstractDBInterface() |
Modifier and Type | Method and Description |
---|---|
abstract java.sql.Connection |
getConnection() |
long |
getSeq(java.lang.String seqName)
Gets the next value in a sequence.
|
long |
getSeq(java.lang.String seqName,
java.sql.Connection connection)
Like the other getSeq, but operates against a particular local db connection, which may be necessary if the sequence generation is part of a transaction.
|
static java.util.List<java.util.List<java.lang.Object>> |
resultSetToListNatural(java.sql.ResultSet rs) |
static java.util.List<java.util.List<java.lang.Object>> |
runPrepQuery(java.sql.Connection con,
java.lang.String stmt,
java.lang.Object... args) |
java.util.List<java.util.List<java.lang.Object>> |
runPrepQuery(java.lang.String stmt,
java.lang.Object... args)
Runs the given SELECT query as a prepared statement, after setting the
arguments in the varargs list.
|
static int |
runPrepUpdate(java.sql.Connection con,
java.lang.String stmt,
java.io.Serializable... args) |
int |
runPrepUpdate(java.lang.String stmt,
java.io.Serializable... args)
Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after
setting the arguments in the varargs list.
|
static java.util.List<java.util.List<java.lang.Object>> |
runQuery(java.sql.Connection con,
java.lang.String query) |
java.util.List<java.util.List<java.lang.Object>> |
runQuery(java.lang.String query)
Runs the given SELECT query, and returns the results in a List of Lists
of Objects.
|
java.lang.Object |
runScalarQuery(java.lang.String query)
Runs the given query.
|
java.lang.Object |
runTransaction(DBInterface.Transaction tx)
Runs the given transaction with a new connection.
|
static int |
runUpdateQuery(java.sql.Connection con,
java.lang.String query) |
int |
runUpdateQuery(java.lang.String query)
Runs the given update query, and returns the number of rows affected.
|
protected boolean |
shouldCloseConnection() |
public abstract java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface DBInterface
java.sql.SQLException
protected boolean shouldCloseConnection()
public static java.util.List<java.util.List<java.lang.Object>> resultSetToListNatural(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public long getSeq(java.lang.String seqName) throws java.sql.SQLException
getSeq
in interface DBInterface
seqName
- java.sql.SQLException
public long getSeq(java.lang.String seqName, java.sql.Connection connection) throws java.sql.SQLException
DBInterface
getSeq
in interface DBInterface
java.sql.SQLException
public static java.util.List<java.util.List<java.lang.Object>> runPrepQuery(java.sql.Connection con, java.lang.String stmt, java.lang.Object... args) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<java.util.List<java.lang.Object>> runPrepQuery(java.lang.String stmt, java.lang.Object... args) throws java.sql.SQLException
DBInterface
runPrepQuery
in interface DBInterface
java.sql.SQLException
public static int runPrepUpdate(java.sql.Connection con, java.lang.String stmt, java.io.Serializable... args) throws java.sql.SQLException
java.sql.SQLException
public int runPrepUpdate(java.lang.String stmt, java.io.Serializable... args) throws java.sql.SQLException
DBInterface
runPrepUpdate
in interface DBInterface
java.sql.SQLException
public static java.util.List<java.util.List<java.lang.Object>> runQuery(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<java.util.List<java.lang.Object>> runQuery(java.lang.String query) throws java.sql.SQLException
DBInterface
runQuery
in interface DBInterface
java.sql.SQLException
public java.lang.Object runScalarQuery(java.lang.String query) throws java.sql.SQLException
runScalarQuery
in interface DBInterface
query
- java.sql.SQLException
public java.lang.Object runTransaction(DBInterface.Transaction tx) throws java.sql.SQLException
runTransaction
in interface DBInterface
java.sql.SQLException
public static int runUpdateQuery(java.sql.Connection con, java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
public int runUpdateQuery(java.lang.String query) throws java.sql.SQLException
runUpdateQuery
in interface DBInterface
query
- java.sql.SQLException