Package org.sqlite.jdbc3
Class JDBC3Statement
- java.lang.Object
-
- org.sqlite.core.CoreStatement
-
- org.sqlite.jdbc3.JDBC3Statement
-
- All Implemented Interfaces:
Codes
- Direct Known Subclasses:
JDBC4Statement
public abstract class JDBC3Statement extends CoreStatement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceJDBC3Statement.SQLCallable<T>
-
Field Summary
Fields Modifier and Type Field Description protected longupdateCount-
Fields inherited from class org.sqlite.core.CoreStatement
batch, batchPos, conn, pointer, resultsWaiting, rs, sql
-
Fields inherited from interface org.sqlite.core.Codes
SQLITE_ABORT, SQLITE_AUTH, SQLITE_BLOB, SQLITE_BUSY, SQLITE_CANTOPEN, SQLITE_CONSTRAINT, SQLITE_CORRUPT, SQLITE_DONE, SQLITE_EMPTY, SQLITE_ERROR, SQLITE_FLOAT, SQLITE_FULL, SQLITE_INTEGER, SQLITE_INTERNAL, SQLITE_INTERRUPT, SQLITE_IOERR, SQLITE_LOCKED, SQLITE_MISMATCH, SQLITE_MISUSE, SQLITE_NOLFS, SQLITE_NOMEM, SQLITE_NOTFOUND, SQLITE_NULL, SQLITE_OK, SQLITE_PERM, SQLITE_PROTOCOL, SQLITE_READONLY, SQLITE_ROW, SQLITE_SCHEMA, SQLITE_TEXT, SQLITE_TOOBIG
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJDBC3Statement(SQLiteConnection conn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBatch(String sql)voidcancel()voidclearBatch()voidclearWarnings()voidclose()booleanexecute(String sql)booleanexecute(String sql, int autoGeneratedKeys)booleanexecute(String sql, int[] colinds)booleanexecute(String sql, String[] colnames)int[]executeBatch()long[]executeLargeBatch()longexecuteLargeUpdate(String sql)longexecuteLargeUpdate(String sql, int autoGeneratedKeys)longexecuteLargeUpdate(String sql, int[] colinds)longexecuteLargeUpdate(String sql, String[] cols)ResultSetexecuteQuery(String sql)ResultSetexecuteQuery(String sql, boolean closeStmt)intexecuteUpdate(String sql)intexecuteUpdate(String sql, int autoGeneratedKeys)intexecuteUpdate(String sql, int[] colinds)intexecuteUpdate(String sql, String[] cols)ConnectiongetConnection()intgetFetchDirection()intgetFetchSize()ResultSetgetGeneratedKeys()As SQLite's last_insert_rowid() function is DB-specific not statement specific, this function introduces a race condition if the same connection is used by two threads and both insert.longgetLargeMaxRows()longgetLargeUpdateCount()This function has a complex behaviour best understood by carefully reading the JavaDoc for getMoreResults() and considering the test StatementTest.execute().intgetMaxFieldSize()intgetMaxRows()booleangetMoreResults()SQLite does not support multiple results from execute().booleangetMoreResults(int current)intgetQueryTimeout()ResultSetgetResultSet()intgetResultSetConcurrency()intgetResultSetHoldability()intgetResultSetType()intgetUpdateCount()This function has a complex behaviour best understood by carefully reading the JavaDoc for getMoreResults() and considering the test StatementTest.execute().SQLWarninggetWarnings()voidsetCursorName(String name)voidsetEscapeProcessing(boolean enable)voidsetFetchDirection(int direction)voidsetFetchSize(int r)voidsetLargeMaxRows(long max)voidsetMaxFieldSize(int max)voidsetMaxRows(int max)voidsetQueryTimeout(int seconds)protected SQLExceptionunsupported()protected <T> TwithConnectionTimeout(JDBC3Statement.SQLCallable<T> callable)-
Methods inherited from class org.sqlite.core.CoreStatement
checkOpen, exec, exec, getConnectionConfig, getDatabase, internalClose, notifyFirstStatementExecuted
-
-
-
-
Constructor Detail
-
JDBC3Statement
protected JDBC3Statement(SQLiteConnection conn)
-
-
Method Detail
-
close
public void close() throws SQLException- Throws:
SQLException- See Also:
Statement.close()
-
execute
public boolean execute(String sql) throws SQLException
- Throws:
SQLException- See Also:
Statement.execute(java.lang.String)
-
execute
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException
- Throws:
SQLException- See Also:
Statement.execute(java.lang.String, int)
-
executeQuery
public ResultSet executeQuery(String sql, boolean closeStmt) throws SQLException
- Specified by:
executeQueryin classCoreStatement- Parameters:
closeStmt- Whether to close this statement when the resultset is closed.- Throws:
SQLException- See Also:
Statement.executeQuery(java.lang.String)
-
executeQuery
public ResultSet executeQuery(String sql) throws SQLException
- Throws:
SQLException- See Also:
Statement.executeQuery(java.lang.String)
-
executeUpdate
public int executeUpdate(String sql) throws SQLException
- Throws:
SQLException- See Also:
Statement.executeUpdate(java.lang.String)
-
executeUpdate
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- Throws:
SQLException- See Also:
Statement.executeUpdate(java.lang.String, int)
-
executeLargeUpdate
public long executeLargeUpdate(String sql) throws SQLException
- Throws:
SQLException- See Also:
Statement.executeLargeUpdate(java.lang.String)
-
executeLargeUpdate
public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException
- Throws:
SQLException- See Also:
Statement.executeLargeUpdate(java.lang.String, int)
-
getResultSet
public ResultSet getResultSet() throws SQLException
- Throws:
SQLException- See Also:
Statement.getResultSet()
-
getUpdateCount
public int getUpdateCount() throws SQLExceptionThis function has a complex behaviour best understood by carefully reading the JavaDoc for getMoreResults() and considering the test StatementTest.execute().- Throws:
SQLException- See Also:
Statement.getUpdateCount()
-
getLargeUpdateCount
public long getLargeUpdateCount() throws SQLExceptionThis function has a complex behaviour best understood by carefully reading the JavaDoc for getMoreResults() and considering the test StatementTest.execute().- Throws:
SQLException- See Also:
Statement.getLargeUpdateCount()
-
addBatch
public void addBatch(String sql) throws SQLException
- Throws:
SQLException- See Also:
Statement.addBatch(java.lang.String)
-
clearBatch
public void clearBatch() throws SQLException- Throws:
SQLException- See Also:
Statement.clearBatch()
-
executeBatch
public int[] executeBatch() throws SQLException- Throws:
SQLException- See Also:
Statement.executeBatch()
-
executeLargeBatch
public long[] executeLargeBatch() throws SQLException- Throws:
SQLException- See Also:
Statement.executeLargeBatch()
-
setCursorName
public void setCursorName(String name)
-
getWarnings
public SQLWarning getWarnings() throws SQLException
- Throws:
SQLException- See Also:
Statement.getWarnings()
-
clearWarnings
public void clearWarnings() throws SQLException- Throws:
SQLException- See Also:
Statement.clearWarnings()
-
getConnection
public Connection getConnection() throws SQLException
- Throws:
SQLException- See Also:
Statement.getConnection()
-
cancel
public void cancel() throws SQLException- Throws:
SQLException- See Also:
Statement.cancel()
-
getQueryTimeout
public int getQueryTimeout() throws SQLException- Throws:
SQLException- See Also:
Statement.getQueryTimeout()
-
setQueryTimeout
public void setQueryTimeout(int seconds) throws SQLException- Throws:
SQLException- See Also:
Statement.setQueryTimeout(int)
-
getMaxRows
public int getMaxRows() throws SQLException- Throws:
SQLException- See Also:
Statement.getMaxRows()
-
getLargeMaxRows
public long getLargeMaxRows() throws SQLException- Throws:
SQLException- See Also:
Statement.getLargeMaxRows()
-
setMaxRows
public void setMaxRows(int max) throws SQLException- Throws:
SQLException- See Also:
Statement.setMaxRows(int)
-
setLargeMaxRows
public void setLargeMaxRows(long max) throws SQLException- Throws:
SQLException- See Also:
Statement.setLargeMaxRows(long)
-
getMaxFieldSize
public int getMaxFieldSize() throws SQLException- Throws:
SQLException- See Also:
Statement.getMaxFieldSize()
-
setMaxFieldSize
public void setMaxFieldSize(int max) throws SQLException- Throws:
SQLException- See Also:
Statement.setMaxFieldSize(int)
-
getFetchSize
public int getFetchSize() throws SQLException- Throws:
SQLException- See Also:
Statement.getFetchSize()
-
setFetchSize
public void setFetchSize(int r) throws SQLException- Throws:
SQLException- See Also:
Statement.setFetchSize(int)
-
getFetchDirection
public int getFetchDirection() throws SQLException- Throws:
SQLException- See Also:
Statement.getFetchDirection()
-
setFetchDirection
public void setFetchDirection(int direction) throws SQLException- Throws:
SQLException- See Also:
Statement.setFetchDirection(int)
-
getGeneratedKeys
public ResultSet getGeneratedKeys() throws SQLException
As SQLite's last_insert_rowid() function is DB-specific not statement specific, this function introduces a race condition if the same connection is used by two threads and both insert.- Throws:
SQLException- See Also:
Statement.getGeneratedKeys()
-
getMoreResults
public boolean getMoreResults() throws SQLExceptionSQLite does not support multiple results from execute().- Throws:
SQLException- See Also:
Statement.getMoreResults()
-
getMoreResults
public boolean getMoreResults(int current) throws SQLException- Throws:
SQLException- See Also:
Statement.getMoreResults(int)
-
getResultSetConcurrency
public int getResultSetConcurrency() throws SQLException- Throws:
SQLException- See Also:
Statement.getResultSetConcurrency()
-
getResultSetHoldability
public int getResultSetHoldability() throws SQLException- Throws:
SQLException- See Also:
Statement.getResultSetHoldability()
-
getResultSetType
public int getResultSetType() throws SQLException- Throws:
SQLException- See Also:
Statement.getResultSetType()
-
setEscapeProcessing
public void setEscapeProcessing(boolean enable)
- See Also:
Statement.setEscapeProcessing(boolean)
-
unsupported
protected SQLException unsupported()
-
execute
public boolean execute(String sql, int[] colinds) throws SQLException
- Throws:
SQLException
-
execute
public boolean execute(String sql, String[] colnames) throws SQLException
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String sql, int[] colinds) throws SQLException
- Throws:
SQLException
-
executeUpdate
public int executeUpdate(String sql, String[] cols) throws SQLException
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql, int[] colinds) throws SQLException
- Throws:
SQLException
-
executeLargeUpdate
public long executeLargeUpdate(String sql, String[] cols) throws SQLException
- Throws:
SQLException
-
withConnectionTimeout
protected <T> T withConnectionTimeout(JDBC3Statement.SQLCallable<T> callable) throws SQLException
- Throws:
SQLException
-
-