Interface DBInterface
- All Known Implementing Classes:
AbstractDBInterface
,PersistenceSession.PersistenceSessionDBInterface
public interface DBInterface
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A transaction represents a sequence of commands that need to be executed as a group, or not at all. -
Method Summary
Modifier and TypeMethodDescriptionlong
Gets the next value in a named integer sequence.long
getSeq
(String seqName, 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.runPrepQuery
(String query, Object... args) Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list.int
runPrepUpdate
(String query, Serializable... args) Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list.Runs the given SELECT query, and returns the results in a List of Lists of Objects.runScalarPrepQuery
(String query, Object... args) Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list.runScalarQuery
(String query) Runs the given SELECT query, returns the value in the first row of the first column, as its natural type.Creates a connection, and runs the given transaction.int
runUpdateQuery
(String query) Runs the given UPDATE/INSERT/DELETE query, and returns the number of rows affected.
-
Method Details
-
getConnection
- Throws:
SQLException
-
runScalarQuery
Runs the given SELECT query, returns the value in the first row of the first column, as its natural type. If no rows are returned, null is returned.- Throws:
SQLException
-
runQuery
Runs the given SELECT query, and returns the results in a List of Lists of Objects.- Throws:
SQLException
-
runPrepQuery
Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list. Returns the results in a List of Lists of Objects.- Throws:
SQLException
-
runUpdateQuery
Runs the given UPDATE/INSERT/DELETE query, and returns the number of rows affected.- Throws:
SQLException
-
runPrepUpdate
Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list. Returns the number of rows affected.- Throws:
SQLException
-
getSeq
Gets the next value in a named integer sequence.- Throws:
SQLException
-
getSeq
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.- Throws:
SQLException
-
runTransaction
Creates a connection, and runs the given transaction. Transactions need to be serializable.- Throws:
SQLException
-
runScalarPrepQuery
Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list. Returns the value in the first row of the first column, as its natural type.- Throws:
SQLException
-