Package org.apache.jena.jdbc.statements
Class JenaStatement
java.lang.Object
org.apache.jena.jdbc.statements.JenaStatement
- All Implemented Interfaces:
AutoCloseable
,Statement
,Wrapper
- Direct Known Subclasses:
DatasetStatement
,JenaPreparedStatement
,RemoteEndpointStatement
Abstract Jena JDBC implementation of a statement that only permits read
operations
-
Field Summary
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
-
Constructor Summary
ConstructorsConstructorDescriptionJenaStatement
(JenaConnection connection) Creates a new statementJenaStatement
(JenaConnection connection, int type, int fetchDir, int fetchSize, int holdability, boolean autoCommit, int transactionLevel) Creates a new statement -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
cancel()
void
void
void
close()
void
final boolean
boolean
boolean
boolean
final int[]
final ResultSet
executeQuery
(String sql) final int
executeUpdate
(String sql) int
executeUpdate
(String sql, int autoGeneratedKeys) int
executeUpdate
(String sql, int[] columnIndexes) int
executeUpdate
(String sql, String[] columnNames) final Connection
int
int
int
Gets the JDBC compatibility level that is in use, seeJdbcCompatibility
for explanationsGets the underlyingJenaConnection
implementation, useful for accessing Jena JDBC specific information such as desired JDBC compatibility levelint
int
boolean
boolean
getMoreResults
(int current) int
final ResultSet
final int
Gets that result sets are read-onlyint
final int
int
final boolean
isClosed()
boolean
final boolean
boolean
isWrapperFor
(Class<?> iface) void
setCursorName
(String name) void
setEscapeProcessing
(boolean enable) void
setFetchDirection
(int direction) void
setFetchSize
(int rows) void
setJdbcCompatibilityLevel
(int level) Sets the JDBC compatibility level that is in use, seeJdbcCompatibility
for explanations.void
setMaxFieldSize
(int max) void
setMaxRows
(int max) void
setPoolable
(boolean poolable) void
setQueryTimeout
(int seconds) <T> T
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.sql.Statement
enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getLargeMaxRows, getLargeUpdateCount, isSimpleIdentifier, setLargeMaxRows
-
Constructor Details
-
JenaStatement
Creates a new statement- Parameters:
connection
- Connection- Throws:
SQLException
- Thrown if the arguments are invalid
-
JenaStatement
public JenaStatement(JenaConnection connection, int type, int fetchDir, int fetchSize, int holdability, boolean autoCommit, int transactionLevel) throws SQLException Creates a new statement- Parameters:
connection
- Connectiontype
- Result Set type for result sets produced by this statementfetchDir
- Fetch DirectionfetchSize
- Fetch Sizeholdability
- Result Set holdabilityautoCommit
- Auto-commit behaviourtransactionLevel
- Transaction level- Throws:
SQLException
- Thrown if there is an error with the statement parameters
-
-
Method Details
-
getJenaConnection
Gets the underlyingJenaConnection
implementation, useful for accessing Jena JDBC specific information such as desired JDBC compatibility level- Returns:
- Underlying Jena Connection
-
getJdbcCompatibilityLevel
public int getJdbcCompatibilityLevel()Gets the JDBC compatibility level that is in use, seeJdbcCompatibility
for explanationsBy default this is set at the connection level and inherited, however you may call
setJdbcCompatibilityLevel(int)
to set the compatibility level for this statement. This allows you to change the compatibility level on a per-query basis if so desired.- Returns:
- Compatibility level
-
setJdbcCompatibilityLevel
public void setJdbcCompatibilityLevel(int level) Sets the JDBC compatibility level that is in use, seeJdbcCompatibility
for explanations.By default this is set at the connection level and inherited, however you may call
setJdbcCompatibilityLevel(int)
to set the compatibility level for this statement. This allows you to change the compatibility level on a per-query basis if so desired.Changing the level may not effect existing open objects, behaviour in this case will be implementation specific.
- Parameters:
level
- Compatibility level
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
addBatch
-
cancel
- Specified by:
cancel
in interfaceStatement
- Throws:
SQLException
-
clearBatch
public void clearBatch()- Specified by:
clearBatch
in interfaceStatement
-
clearWarnings
public void clearWarnings()- Specified by:
clearWarnings
in interfaceStatement
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
execute
- Specified by:
execute
in interfaceStatement
- Throws:
SQLException
-
executeBatch
- Specified by:
executeBatch
in interfaceStatement
- Throws:
SQLException
-
executeQuery
- Specified by:
executeQuery
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
executeUpdate
- Specified by:
executeUpdate
in interfaceStatement
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceStatement
-
getFetchDirection
public int getFetchDirection()- Specified by:
getFetchDirection
in interfaceStatement
-
getFetchSize
public int getFetchSize()- Specified by:
getFetchSize
in interfaceStatement
-
getGeneratedKeys
- Specified by:
getGeneratedKeys
in interfaceStatement
- Throws:
SQLException
-
getMaxFieldSize
public int getMaxFieldSize()- Specified by:
getMaxFieldSize
in interfaceStatement
-
getMaxRows
public int getMaxRows()- Specified by:
getMaxRows
in interfaceStatement
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
getMoreResults
- Specified by:
getMoreResults
in interfaceStatement
- Throws:
SQLException
-
getQueryTimeout
public int getQueryTimeout()- Specified by:
getQueryTimeout
in interfaceStatement
-
getResultSet
- Specified by:
getResultSet
in interfaceStatement
- Throws:
SQLException
-
getResultSetConcurrency
public final int getResultSetConcurrency()Gets that result sets are read-only- Specified by:
getResultSetConcurrency
in interfaceStatement
-
getResultSetHoldability
public int getResultSetHoldability()- Specified by:
getResultSetHoldability
in interfaceStatement
-
getResultSetType
public final int getResultSetType()- Specified by:
getResultSetType
in interfaceStatement
-
getUpdateCount
public int getUpdateCount()- Specified by:
getUpdateCount
in interfaceStatement
-
getWarnings
- Specified by:
getWarnings
in interfaceStatement
-
isClosed
public final boolean isClosed() -
isPoolable
public final boolean isPoolable()- Specified by:
isPoolable
in interfaceStatement
-
setCursorName
- Specified by:
setCursorName
in interfaceStatement
- Throws:
SQLException
-
setEscapeProcessing
public void setEscapeProcessing(boolean enable) - Specified by:
setEscapeProcessing
in interfaceStatement
-
setFetchDirection
- Specified by:
setFetchDirection
in interfaceStatement
- Throws:
SQLException
-
setFetchSize
public void setFetchSize(int rows) - Specified by:
setFetchSize
in interfaceStatement
-
setMaxFieldSize
public void setMaxFieldSize(int max) - Specified by:
setMaxFieldSize
in interfaceStatement
-
setMaxRows
public void setMaxRows(int max) - Specified by:
setMaxRows
in interfaceStatement
-
setPoolable
public void setPoolable(boolean poolable) - Specified by:
setPoolable
in interfaceStatement
-
setQueryTimeout
public void setQueryTimeout(int seconds) - Specified by:
setQueryTimeout
in interfaceStatement
-
isCloseOnCompletion
public boolean isCloseOnCompletion()- Specified by:
isCloseOnCompletion
in interfaceStatement
-
closeOnCompletion
- Specified by:
closeOnCompletion
in interfaceStatement
- Throws:
SQLException
-