public abstract class SQLiteConnection extends Object implements Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Constructor and Description |
|---|
SQLiteConnection(DB db)
Connection constructor for reusing an existing DB handle
|
SQLiteConnection(String url,
String fileName)
Constructor to create a connection to a database at the given location.
|
SQLiteConnection(String url,
String fileName,
Properties prop)
Constructor to create a pre-configured connection to a database at the
given location.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
void |
addCommitListener(SQLiteCommitListener listener)
Add a listener for DB commit/rollback events, see https://www.sqlite.org/c3ref/commit_hook.html
|
void |
addUpdateListener(SQLiteUpdateListener listener)
Add a listener for DB update events, see https://www.sqlite.org/c3ref/update_hook.html
|
protected void |
checkCursor(int rst,
int rsc,
int rsh)
Checks whether the type, concurrency, and holdability settings for a
ResultSet are supported by the SQLite interface. |
protected void |
checkOpen()
Whether an SQLite library interface to the database has been established.
|
void |
close() |
void |
commit() |
protected static String |
extractPragmasFromFilename(String url,
String filename,
Properties prop)
Extracts PRAGMA values from the filename and sets them into the Properties
object which will be used to build the SQLConfig.
|
boolean |
getAutoCommit() |
int |
getBusyTimeout() |
SQLiteConnectionConfig |
getConnectionConfig() |
DB |
getDatabase() |
void |
getLimit(SQLiteLimits limit) |
DatabaseMetaData |
getMetaData() |
int |
getNetworkTimeout() |
String |
getSchema() |
CoreDatabaseMetaData |
getSQLiteDatabaseMetaData() |
int |
getTransactionIsolation() |
String |
getUrl() |
boolean |
isClosed() |
String |
libversion() |
void |
removeCommitListener(SQLiteCommitListener listener)
Remove a listener registered for DB commit/rollback events.
|
void |
removeUpdateListener(SQLiteUpdateListener listener)
Remove a listener registered for DB update events.
|
void |
rollback() |
void |
setAutoCommit(boolean ac) |
void |
setBusyTimeout(int timeoutMillis)
Sets the timeout value for the connection.
|
void |
setLimit(SQLiteLimits limit,
int value) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
void |
setSchema(String schema) |
void |
setTransactionIsolation(int level) |
protected void |
setTransactionMode(SQLiteConfig.TransactionMode mode)
Sets the mode that will be used to start transactions on this connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearWarnings, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getCatalog, getClientInfo, getClientInfo, getHoldability, getTypeMap, getWarnings, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTypeMapisWrapperFor, unwrappublic SQLiteConnection(DB db)
db - public SQLiteConnection(String url, String fileName) throws SQLException
url - The location of the database.fileName - The database.SQLExceptionpublic SQLiteConnection(String url, String fileName, Properties prop) throws SQLException
url - The location of the database file.fileName - The database.prop - The configurations to apply.SQLExceptionpublic SQLiteConnectionConfig getConnectionConfig()
public CoreDatabaseMetaData getSQLiteDatabaseMetaData() throws SQLException
SQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic String getUrl()
public void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema in interface ConnectionSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface ConnectionSQLExceptionpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout in interface ConnectionSQLExceptionpublic int getNetworkTimeout()
throws SQLException
getNetworkTimeout in interface ConnectionSQLExceptionprotected void checkCursor(int rst,
int rsc,
int rsh)
throws SQLException
ResultSet are supported by the SQLite interface. Supported
settings are:ResultSet.TYPE_FORWARD_ONLYResultSet.CONCUR_READ_ONLY)ResultSet.CLOSE_CURSORS_AT_COMMITrst - the type setting.rsc - the concurrency setting.rsh - the holdability setting.SQLExceptionprotected void setTransactionMode(SQLiteConfig.TransactionMode mode)
mode - One of SQLiteConfig.TransactionModepublic int getTransactionIsolation()
getTransactionIsolation in interface ConnectionConnection.getTransactionIsolation()public void setTransactionIsolation(int level)
throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionConnection.setTransactionIsolation(int)public DB getDatabase()
public boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionConnection.getAutoCommit()public void setAutoCommit(boolean ac)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionConnection.setAutoCommit(boolean)public int getBusyTimeout()
public void setBusyTimeout(int timeoutMillis)
throws SQLException
timeoutMillis - The timeout value in milliseconds.SQLExceptionpublic void setLimit(SQLiteLimits limit, int value) throws SQLException
SQLExceptionpublic void getLimit(SQLiteLimits limit) throws SQLException
SQLExceptionpublic boolean isClosed()
throws SQLException
isClosed in interface ConnectionSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionConnection.close()protected void checkOpen()
throws SQLException
SQLExceptionpublic String libversion() throws SQLException
SQLExceptionpublic void commit()
throws SQLException
commit in interface ConnectionSQLExceptionConnection.commit()public void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionConnection.rollback()public void addUpdateListener(SQLiteUpdateListener listener)
listener - The listener to receive update eventspublic void removeUpdateListener(SQLiteUpdateListener listener)
listener - The listener to no longer receive update eventspublic void addCommitListener(SQLiteCommitListener listener)
listener - The listener to receive commit eventspublic void removeCommitListener(SQLiteCommitListener listener)
listener - The listener to no longer receive commit/rollback events.protected static String extractPragmasFromFilename(String url, String filename, Properties prop) throws SQLException
filename - prop - SQLExceptionCopyright © 2021. All rights reserved.