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 DBInterfacejava.sql.SQLExceptionprotected boolean shouldCloseConnection()
public static java.util.List<java.util.List<java.lang.Object>> resultSetToListNatural(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionpublic long getSeq(java.lang.String seqName)
throws java.sql.SQLException
getSeq in interface DBInterfacejava.sql.SQLExceptionpublic long getSeq(java.lang.String seqName,
java.sql.Connection connection)
throws java.sql.SQLException
DBInterfacegetSeq in interface DBInterfacejava.sql.SQLExceptionpublic 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.SQLExceptionpublic java.util.List<java.util.List<java.lang.Object>> runPrepQuery(java.lang.String stmt,
java.lang.Object... args)
throws java.sql.SQLException
DBInterfacerunPrepQuery in interface DBInterfacejava.sql.SQLExceptionpublic static int runPrepUpdate(java.sql.Connection con,
java.lang.String stmt,
java.io.Serializable... args)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int runPrepUpdate(java.lang.String stmt,
java.io.Serializable... args)
throws java.sql.SQLException
DBInterfacerunPrepUpdate in interface DBInterfacejava.sql.SQLExceptionpublic 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.SQLExceptionpublic java.util.List<java.util.List<java.lang.Object>> runQuery(java.lang.String query)
throws java.sql.SQLException
DBInterfacerunQuery in interface DBInterfacejava.sql.SQLExceptionpublic java.lang.Object runScalarQuery(java.lang.String query)
throws java.sql.SQLException
runScalarQuery in interface DBInterfacejava.sql.SQLExceptionpublic java.lang.Object runTransaction(DBInterface.Transaction tx) throws java.sql.SQLException
runTransaction in interface DBInterfacejava.sql.SQLExceptionpublic static int runUpdateQuery(java.sql.Connection con,
java.lang.String query)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int runUpdateQuery(java.lang.String query)
throws java.sql.SQLException
runUpdateQuery in interface DBInterfacejava.sql.SQLException