public interface DBInterface
Modifier and Type | Interface and Description |
---|---|
static interface |
DBInterface.Transaction
A transaction represents a sequence of commands that need to be executed
as a group, or not at all.
|
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection() |
long |
getSeq(java.lang.String seqName)
Gets the next value in a named integer 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.
|
java.util.List<java.util.List<java.lang.Object>> |
runPrepQuery(java.lang.String query,
java.lang.Object... args)
Runs the given SELECT query as a prepared statement, after setting the
arguments in the varargs list.
|
int |
runPrepUpdate(java.lang.String query,
java.io.Serializable... args)
Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after
setting the arguments in the varargs list.
|
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 SELECT query, returns the value in the first row of the
first column, as its natural type.
|
java.lang.Object |
runTransaction(DBInterface.Transaction tx)
Creates a connection, and runs the given transaction.
|
int |
runUpdateQuery(java.lang.String query)
Runs the given UPDATE/INSERT/DELETE query, and returns the number of rows
affected.
|
java.sql.Connection getConnection() throws java.sql.SQLException
java.sql.SQLException
java.lang.Object runScalarQuery(java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
java.util.List<java.util.List<java.lang.Object>> runQuery(java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
java.util.List<java.util.List<java.lang.Object>> runPrepQuery(java.lang.String query, java.lang.Object... args) throws java.sql.SQLException
java.sql.SQLException
int runUpdateQuery(java.lang.String query) throws java.sql.SQLException
java.sql.SQLException
int runPrepUpdate(java.lang.String query, java.io.Serializable... args) throws java.sql.SQLException
java.sql.SQLException
long getSeq(java.lang.String seqName) throws java.sql.SQLException
java.sql.SQLException
long getSeq(java.lang.String seqName, java.sql.Connection connection) throws java.sql.SQLException
java.sql.SQLException
java.lang.Object runTransaction(DBInterface.Transaction tx) throws java.sql.SQLException
java.sql.SQLException