Class AbstractDBInterface
java.lang.Object
com.inductiveautomation.ignition.gateway.localdb.AbstractDBInterface
- All Implemented Interfaces:
- DBInterface
- Direct Known Subclasses:
- PersistenceSession.PersistenceSessionDBInterface
Created by colby.clegg on 11/17/2015.
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.inductiveautomation.ignition.gateway.localdb.DBInterfaceDBInterface.Transaction
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract ConnectionlongGets the next value in a sequence.longgetSeq(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 stmt, Object... args) Runs the given SELECT query as a prepared statement, after setting the arguments in the varargs list.runPrepQuery(Connection con, String stmt, Object... args) intrunPrepUpdate(String stmt, Serializable... args) Runs the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list.static intrunPrepUpdate(Connection con, String stmt, Serializable... args) Runs the given SELECT query, and returns the results in a List of Lists of Objects.runQuery(Connection con, String query) runScalarQuery(String query) Runs the given query.Runs the given transaction with a new connection.intrunUpdateQuery(String query) Runs the given update query, and returns the number of rows affected.static intrunUpdateQuery(Connection con, String query) protected boolean
- 
Constructor Details- 
AbstractDBInterfacepublic AbstractDBInterface()
 
- 
- 
Method Details- 
getConnection- Specified by:
- getConnectionin interface- DBInterface
- Throws:
- SQLException
 
- 
shouldCloseConnectionprotected boolean shouldCloseConnection()
- 
resultSetToListNatural- Throws:
- SQLException
 
- 
getSeqGets the next value in a sequence.- Specified by:
- getSeqin interface- DBInterface
- Throws:
- SQLException
 
- 
getSeqDescription copied from interface:DBInterfaceLike the other getSeq, but operates against a particular local db connection, which may be necessary if the sequence generation is part of a transaction.- Specified by:
- getSeqin interface- DBInterface
- Throws:
- SQLException
 
- 
runPrepQuerypublic static List<List<Object>> runPrepQuery(Connection con, String stmt, Object... args) throws SQLException - Throws:
- SQLException
 
- 
runPrepQueryDescription copied from interface:DBInterfaceRuns 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.- Specified by:
- runPrepQueryin interface- DBInterface
- Throws:
- SQLException
 
- 
runPrepUpdatepublic static int runPrepUpdate(Connection con, String stmt, Serializable... args) throws SQLException - Throws:
- SQLException
 
- 
runPrepUpdateDescription copied from interface:DBInterfaceRuns the given UPDATE/INSERT/DELETE query as a prepared statement, after setting the arguments in the varargs list. Returns the number of rows affected.- Specified by:
- runPrepUpdatein interface- DBInterface
- Throws:
- SQLException
 
- 
runQuery- Throws:
- SQLException
 
- 
runQueryDescription copied from interface:DBInterfaceRuns the given SELECT query, and returns the results in a List of Lists of Objects.- Specified by:
- runQueryin interface- DBInterface
- Throws:
- SQLException
 
- 
runScalarQueryRuns the given query. Returns null if no rows are returned, or the value at row 1 column 1 as a string if rows are returned.- Specified by:
- runScalarQueryin interface- DBInterface
- Throws:
- SQLException
 
- 
runTransactionRuns the given transaction with a new connection. Closes the connection if the transaction doesn't do it.- Specified by:
- runTransactionin interface- DBInterface
- Throws:
- SQLException
 
- 
runUpdateQuery- Throws:
- SQLException
 
- 
runUpdateQueryRuns the given update query, and returns the number of rows affected.- Specified by:
- runUpdateQueryin interface- DBInterface
- Throws:
- SQLException
 
 
-