Package org.monetdb.monetdbe
Class MonetConnection
java.lang.Object
org.monetdb.monetdbe.MonetWrapper
org.monetdb.monetdbe.MonetConnection
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
public class MonetConnection extends MonetWrapper implements Connection
A
Connection suitable for the MonetDB database.
This connection represents a connection (session) to a MonetDB
database. SQL statements are executed and results are returned within
the context of a connection. This Connection object holds a physical
connection to the MonetDB database.
A Connection object's database should able to provide information
describing its tables, its supported SQL grammar, its stored
procedures, the capabilities of this connection, and so on. This
information is obtained with the getMetaData method.
Note: By default a Connection object is in auto-commit mode, which
means that it automatically commits changes after executing each
statement. If auto-commit mode has been disabled, the method commit
must be called explicitly in order to commit changes; otherwise,
database changes will not be saved.-
Field Summary
Fields Modifier and Type Field Description protected ByteBufferdbNativeThe pointer to the C database objectFields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Method Summary
Modifier and Type Method Description voidabort(Executor executor)Terminates an open connection.voidclearWarnings()Clears all warnings reported for this Connection object.voidclose()Releases this Connection object's database and JDBC resources immediately.voidcommit()Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object.ArraycreateArrayOf(String typeName, Object[] elements)Arrays are not yet currently supported.BlobcreateBlob()Constructs an object that implements the Blob interface.ClobcreateClob()Constructs an object that implements the Clob interface.NClobcreateNClob()NClobs are not yet currently supported.SQLXMLcreateSQLXML()SQL XML is not yet currently supported.StatementcreateStatement()Creates a Statement object for sending SQL statements to the database.StatementcreateStatement(int resultSetType, int resultSetConcurrency)Creates a Statement object that will generate ResultSet objects with the given type and concurrency.StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)Creates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability.StructcreateStruct(String typeName, Object[] attributes)Structs are not yet currently supported.booleangetAutoCommit()Retrieves the current auto-commit mode for this Connection object.StringgetCatalog()Retrieves this Connection object's current catalog name.PropertiesgetClientInfo()Returns a list containing the name and current value of each client info property supported by the driver.StringgetClientInfo(String name)Returns the value of the client info property specified by name.protected ByteBuffergetDbNative()Retrieve the C pointer to the database.intgetHoldability()Retrieves the current holdability of ResultSet objects created using this Connection object.StringgetJdbcURL()Returns the full JDBC Connection URL used for connecting to the database.intgetMaxConnections()Returns the maximum number of possible active connections.DatabaseMetaDatagetMetaData()Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection.intgetNetworkTimeout()Retrieves the number of milliseconds the driver will wait for a database request to complete.StringgetSchema()Retrieves this Connection object's current schema name.intgetTransactionIsolation()Retrieves this Connection object's current transaction isolation level.Map<String,Class<?>>getTypeMap()Retrieves the Map object associated with this Connection object.StringgetUserName()Returns the full JDBC Connection URL used for connecting to the database.SQLWarninggetWarnings()Retrieves the first warning reported by calls on this Connection object.booleanisClosed()Retrieves whether this Connection object has been closed.booleanisReadOnly()Retrieves whether this Connection object is in read-only mode.booleanisValid(int timeout)Returns true if the connection has not been closed and is still valid.StringnativeSQL(String sql)Converts the given SQL statement into the system's native SQL grammar.CallableStatementprepareCall(String sql)Creates a CallableStatement object for calling database stored procedures.CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency)Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.CallableStatementprepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Creates a CallableStatement object that will generate ResultSet objects with the given type and concurrency.PreparedStatementprepareStatement(String sql)Creates a PreparedStatement object for sending parameterized SQL statements to the database.PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)Auto-generated keys are not yet currently supported.PreparedStatementprepareStatement(String sql, int[] columnIndexes)Auto-generated keys are not yet currently supported.PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)Creates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency.PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)Creates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability.PreparedStatementprepareStatement(String sql, String[] columnNames)Auto-generated keys are not yet currently supported.voidreleaseSavepoint(Savepoint savepoint)Savepoints are not yet currently supported.voidrollback()Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object.voidrollback(Savepoint savepoint)Savepoints are not yet currently supported.voidsetAutoCommit(boolean autoCommit)Sets this connection's auto-commit mode to the given state.voidsetCatalog(String catalog)Sets the given catalog name in order to select a subspace of this Connection object's database in which to work.voidsetClientInfo(String name, String value)Sets the value of the client info property specified by name to the value specified by value.voidsetClientInfo(Properties properties)Sets the value of the connection's client info properties.voidsetHoldability(int holdability)Changes the default holdability of ResultSet objects created using this Connection object to the given holdability.voidsetNetworkTimeout(Executor executor, int milliseconds)Sets the maximum period a Connection or objects created from the Connection will wait for the database to reply to any one request.voidsetReadOnly(boolean readOnly)Puts this connection in read-only mode as a hint to the driver to enable database optimizations.SavepointsetSavepoint()Savepoints are not yet currently supported.SavepointsetSavepoint(String name)Savepoints are not yet currently supported.voidsetSchema(String schema)Sets the given schema name to access.voidsetTransactionIsolation(int level)Attempts to change the transaction isolation level for this Connection object to the one given.voidsetTypeMap(Map<String,Class<?>> map)Installs the given TypeMap object as the type map for this Connection object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Field Details
-
dbNative
The pointer to the C database object
-
-
Method Details
-
commit
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.- Specified by:
commitin interfaceConnection- Throws:
SQLException- if a database access error occurs- See Also:
setAutoCommit(boolean)
-
rollback
Undoes all changes made in the current transaction and releases any database locks currently held by this Connection object. This method should be used only when auto-commit mode has been disabled.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- if a database access error occurs- See Also:
setAutoCommit(boolean)
-
close
Releases this Connection object's database and JDBC resources immediately. All Statements created from this Connection will be closed when this method is called. Calling the method close on a Connection object that is already closed is a no-op.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Throws:
SQLException- if a database access error occurs
-
isClosed
Retrieves whether this Connection object has been closed. This method cannot be called to determine whether a connection to a database is valid or invalid. A typical client can determine that a connection is invalid by using theisValid()method.- Specified by:
isClosedin interfaceConnection- Returns:
- true if this Connection object is closed; false if it is still open
- Throws:
SQLException- if a database access error occurs
-
abort
Terminates an open connection. The current implementation doesn't use the Executor argument, meaning it is identical to theclose()method.- Specified by:
abortin interfaceConnection- Parameters:
executor- The Executor implementation which will be used by abort (not used)- Throws:
SQLException- if a database access error occurs or the executor is null
-
isValid
Returns true if the connection has not been closed and is still valid. The driver will submit a query on the connection to verify the connection is still valid when this method is called. The timeout parameter is not currently used (executes as if it is equal to 0).- Specified by:
isValidin interfaceConnection- Parameters:
timeout- Not currently used. The time in seconds to wait for the database operation used to validate the connection to complete.- Returns:
- true if the connection is valid, false otherwise
- Throws:
SQLException- if the value supplied for timeout is less than 0
-
getWarnings
Retrieves the first warning reported by calls on this Connection object. If there is more than one warning, subsequent warnings will be chained to the first one and can be retrieved by calling the method SQLWarning.getNextWarning on the warning that was retrieved previously.- Specified by:
getWarningsin interfaceConnection- Returns:
- the first SQLWarning object or null if there are none
- Throws:
SQLException- if a database access error occurs or this method is called on a closed connection
-
clearWarnings
Clears all warnings reported for this Connection object. After a call to this method, the method getWarnings returns null until a new warning is reported for this Connection object.- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException- if a database access error occurs or this method is called on a closed connection
-
getDbNative
Retrieve the C pointer to the database. Used in ResultSet, Statement and PreparedStatement- Returns:
- C pointer to the database
-
setAutoCommit
Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.- Specified by:
setAutoCommitin interfaceConnection- Parameters:
autoCommit- true to enable auto-commit mode; false to disable it- Throws:
SQLException- if a database access error occurs- See Also:
getAutoCommit()
-
getAutoCommit
Retrieves the current auto-commit mode for this Connection object.- Specified by:
getAutoCommitin interfaceConnection- Returns:
- the current state of this Connection object's auto-commit mode
- Throws:
SQLException- See Also:
setAutoCommit(boolean)
-
getMetaData
Retrieves a DatabaseMetaData object that contains metadata about the database to which this Connection object represents a connection. The metadata includes information about the database's tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on.- Specified by:
getMetaDatain interfaceConnection- Returns:
- a DatabaseMetaData object for this Connection object
- Throws:
SQLException- if the current language is not SQL
-
setReadOnly
Puts this connection in read-only mode as a hint to the driver to enable database optimizations. MonetDB doesn't support read-only mode, hence an SQLWarning is generated if attempted to set to true here.- Specified by:
setReadOnlyin interfaceConnection- Parameters:
readOnly- true attempts to turn on read-only mode; false disables it- Throws:
SQLException- if a database access error occurs or this method is called during a transaction.
-
isReadOnly
Retrieves whether this Connection object is in read-only mode. MonetDB Connection objects are never in read-only mode.- Specified by:
isReadOnlyin interfaceConnection- Returns:
- false, as MonetDB doesn't support read-only mode
- Throws:
SQLException
-
setCatalog
Sets the given catalog name in order to select a subspace of this Connection object's database in which to work. Because MonetDB does not support catalogs, the driver will silently ignore this request.- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getCatalog
Retrieves this Connection object's current catalog name. Because MonetDB does not support catalogs, the driver will return a null.- Specified by:
getCatalogin interfaceConnection- Returns:
- the current catalog name or null if there is none
- Throws:
SQLException
-
setTransactionIsolation
Attempts to change the transaction isolation level for this Connection object to the one given. This driver only supports TRANSACTION_SERIALIZABLE, so a warning will be generated if another level is set.- Specified by:
setTransactionIsolationin interfaceConnection- Parameters:
level- one of the following Connection constants: Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_SERIALIZABLE.- Throws:
SQLException
-
getTransactionIsolation
Retrieves this Connection object's current transaction isolation level.- Specified by:
getTransactionIsolationin interfaceConnection- Returns:
- the current transaction isolation level, which will be Connection.TRANSACTION_SERIALIZABLE
- Throws:
SQLException
-
getTypeMap
Retrieves the Map object associated with this Connection object. Unless the application has added an entry, the type map returned will be empty. Not supported currently.- Specified by:
getTypeMapin interfaceConnection- Returns:
- the java.util.Map object associated with this Connection object
- Throws:
SQLException
-
setTypeMap
Installs the given TypeMap object as the type map for this Connection object. The type map will be used for the custom mapping of SQL structured types and distinct types. Not supported currently.- Specified by:
setTypeMapin interfaceConnection- Parameters:
map- the java.util.Map object to install as the replacement for this Connection object's default type map- Throws:
SQLException
-
setHoldability
Changes the default holdability of ResultSet objects created using this Connection object to the given holdability. This driver only supports HOLD_CURSORS_OVER_COMMIT, so an exception will be thrown if another one is set- Specified by:
setHoldabilityin interfaceConnection- Parameters:
holdability- - a ResultSet holdability constant; one of ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT- Throws:
SQLFeatureNotSupportedException- - if a holdability different from HOLD_CURSORS_OVER_COMMIT is set.SQLException
-
getHoldability
Retrieves the current holdability of ResultSet objects created using this Connection object.- Specified by:
getHoldabilityin interfaceConnection- Returns:
- ResultSet.HOLD_CURSORS_OVER_COMMIT
- Throws:
SQLException
-
setClientInfo
Sets the value of the client info property specified by name to the value specified by value. Options supported by the driver can be determined by callingDriver.getPropertyInfo(String, Properties)Options set with this method are currently not used, as changing the options after starting a new connection is not supported. Configurations must be currently set prior to starting a new connection to the database- Specified by:
setClientInfoin interfaceConnection- Parameters:
name- - The name of the client info property to setvalue- - The value to set the client info property to. If the value is null, the current value of the specified property is cleared.- Throws:
SQLClientInfoException- - if the database server returns an error while setting the clientInfo values on the database server or this method is called on a closed connection
-
setClientInfo
Sets the value of the connection's client info properties. The Properties object contains the names and values of the client info properties to be set. The set of client info properties contained in the properties list replaces the current set of client info properties on the connection. Options supported by the driver can be determined by callingDriver.getPropertyInfo(String, Properties)Options set with this method are currently not used, as changing the options after starting a new connection is not supported. Configurations must be currently set prior to starting a new connection to the database- Specified by:
setClientInfoin interfaceConnection- Parameters:
properties- - The list of client info properties to set- Throws:
SQLClientInfoException- - if the database server returns an error while setting the clientInfo values on the database server or this method is called on a closed connection
-
getClientInfo
Returns the value of the client info property specified by name. This method may return null if the specified client info property has not been set and does not have a default value. Options supported by the driver can be determined by callingDriver.getPropertyInfo(String, Properties)- Specified by:
getClientInfoin interfaceConnection- Parameters:
name- - The name of the client info property to retrieve- Returns:
- The value of the client info property specified or null
- Throws:
SQLException
-
getClientInfo
Returns a list containing the name and current value of each client info property supported by the driver. The value of a client info property may be null if the property has not been set and does not have a default value. Options supported by the driver can be determined by callingDriver.getPropertyInfo(String, Properties)- Specified by:
getClientInfoin interfaceConnection- Returns:
- A Properties object that contains the name and current value of each of the client info properties supported by the driver.
- Throws:
SQLException
-
setSchema
Sets the given schema name to access.- Specified by:
setSchemain interfaceConnection- Parameters:
schema- the name of a schema in which to work- Throws:
SQLException- if a database access error occurs or this method is called on a closed connection
-
getSchema
Retrieves this Connection object's current schema name.- Specified by:
getSchemain interfaceConnection- Returns:
- the current schema name or null if there is none
- Throws:
SQLException- if a database access error occurs or this method is called on a closed connection
-
setNetworkTimeout
Sets the maximum period a Connection or objects created from the Connection will wait for the database to reply to any one request. This functionality is currently not implemented.- Specified by:
setNetworkTimeoutin interfaceConnection- Parameters:
executor- The Executor implementation which will be used by setNetworkTimeoutmilliseconds- The time in milliseconds to wait for the database operation to complete- Throws:
SQLException- if a database access error occurs, this method is called on a closed connection, the executor is null, or the value specified for seconds is less than 0.
-
getNetworkTimeout
Retrieves the number of milliseconds the driver will wait for a database request to complete. If the limit is exceeded, a SQLException is thrown. This functionality is currently not implemented.- Specified by:
getNetworkTimeoutin interfaceConnection- Returns:
- the current timeout limit in milliseconds; zero means there is no limit
- Throws:
SQLException- if a database access error occurs or this method is called on a closed Connection
-
nativeSQL
Converts the given SQL statement into the system's native SQL grammar. This feature is currently not supported- Specified by:
nativeSQLin interfaceConnection- Parameters:
sql- - an SQL statement that may contain one or more '?' parameter placeholders.- Returns:
- the native form of this statement
-
getJdbcURL
Returns the full JDBC Connection URL used for connecting to the database. It is called from getURL()in MonetDatabaseMetaData.- Returns:
- the MonetDB JDBC Connection URL
-
getUserName
Returns the full JDBC Connection URL used for connecting to the database. It is called from getUserName()in MonetDatabaseMetaData.- Returns:
- the current User Name
- Throws:
SQLException- if the user could not be fetched or if this method is called on a closed Connection
-
getMaxConnections
Returns the maximum number of possible active connections. It is called from getMaxConnections()in MonetDatabaseMetaData- Returns:
- the maximum number of active connections possible at one time; a result of zero means that there is no limit or the limit is not known
- Throws:
SQLException- if this method is called on a closed Connection
-
createStatement
Creates a Statement object for sending SQL statements to the database. SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it may be more efficient to use a PreparedStatement object. Result sets created using the returned Statement object will by default be type TYPE_SCROLL_INSENSITIVE and have a concurrency level of CONCUR_READ_ONLY and a holdability of HOLD_CURSORS_OVER_COMMIT.- Specified by:
createStatementin interfaceConnection- Returns:
- a new default Statement object
- Throws:
SQLException- if a database access error occurs
-
createStatement
Creates a Statement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the createStatement method above, but it allows the default result set type and concurrency to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
createStatementin interfaceConnection- Parameters:
resultSetType- a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE- Returns:
- a new Statement object that will generate ResultSet objects with the given type and concurrency
- Throws:
SQLException- if a database access error occurs
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLExceptionCreates a Statement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the createStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
createStatementin interfaceConnection- Parameters:
resultSetType- one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability- one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT- Returns:
- a new Statement object that will generate ResultSet objects with the given type, concurrency, and holdability
- Throws:
SQLException- if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
-
prepareCall
Creates a CallableStatement object for calling database stored procedures. The CallableStatement object provides methods for setting up its IN parameters, and methods for executing the call to a stored procedure. Result sets created using the returned CallableStatement object will by default be type TYPE_SCROLL_INSENSITIVE, have a concurrency level of CONCUR_READ_ONLY and have holdability of HOLD_CURSORS_OVER_COMMIT.- Specified by:
prepareCallin interfaceConnection- Parameters:
sql- - an SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is specified using JDBC call escape syntax.- Returns:
- a new default CallableStatement object containing the pre-compiled SQL statement
- Throws:
SQLException- - if a database access error occurs or this method is called on a closed connection
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLExceptionCreates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareCall method above, but it allows the default result set type and concurrency to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
prepareCallin interfaceConnection- Parameters:
sql- - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters Typically this statement is specified using JDBC call escape syntax.resultSetType- - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE- Returns:
- a new CallableStatement object containing the pre-compiled SQL statement that will produce ResultSet objects with the given type and concurrency
- Throws:
SQLException- - if a database access error occurs, this method is called on a closed connection or the given parameters are not ResultSet constants indicating type and concurrency
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLExceptionCreates a CallableStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareCall method above, but it allows the default result set type, result set concurrency type and holdability to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
prepareCallin interfaceConnection- Parameters:
sql- - a String object that is the SQL statement to be sent to the database; may contain on or more '?' parameters Typically this statement is specified using JDBC call escape syntax.resultSetType- - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability- - one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT- Returns:
- a new CallableStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
- Throws:
SQLException- - if a database access error occurs, this method is called on a closed connection or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
-
prepareStatement
Creates a PreparedStatement object for sending parameterized SQL statements to the database. A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. Result sets created using the returned PreparedStatement object will by default be type TYPE_SCROLL_INSENSITIVE, have a concurrency level of CONCUR_READ_ONLY and have holdability of HOLD_CURSORS_OVER_COMMIT- Specified by:
prepareStatementin interfaceConnection- Parameters:
sql- an SQL statement that may contain one or more '?' IN parameter placeholders- Returns:
- a new default PreparedStatement object containing the pre-compiled SQL statement
- Throws:
SQLException- if a database access error occurs
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLExceptionCreates a PreparedStatement object that will generate ResultSet objects with the given type and concurrency. This method is the same as the prepareStatement method above, but it allows the default result set type and concurrency to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
prepareStatementin interfaceConnection- Parameters:
sql- a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parametersresultSetType- a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE- Returns:
- a new PreparedStatement object containing the pre-compiled SQL statement that will produce ResultSet objects with the given type and concurrency
- Throws:
SQLException- if a database access error occurs or the given parameters are not ResultSet constants indicating type and concurrency
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLExceptionCreates a PreparedStatement object that will generate ResultSet objects with the given type, concurrency, and holdability. This method is the same as the prepareStatement method above, but it allows the default result set type, concurrency, and holdability to be overridden. Non-default result set properties are ignored in the current version.- Specified by:
prepareStatementin interfaceConnection- Parameters:
sql- a String object that is the SQL statement to be sent to the database; may contain one or more ? IN parametersresultSetType- one of the following ResultSet constants: ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency- one of the following ResultSet constants: ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLEresultSetHoldability- one of the following ResultSet constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT- Returns:
- a new PreparedStatement object, containing the pre-compiled SQL statement, that will generate ResultSet objects with the given type, concurrency, and holdability
- Throws:
SQLException- if a database access error occurs or the given parameters are not ResultSet constants indicating type, concurrency, and holdability
-
prepareStatement
Auto-generated keys are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
Auto-generated keys are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
Auto-generated keys are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
setSavepoint
Savepoints are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
setSavepoint
Savepoints are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
rollback
Savepoints are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
Savepoints are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
createClob
Constructs an object that implements the Clob interface. The object returned initially contains no data.- Specified by:
createClobin interfaceConnection- Returns:
- a MonetClob instance
- Throws:
SQLException- - if an object that implements the Clob interface can not be constructed, this method is called on a closed connection or a database access error occurs.
-
createBlob
Constructs an object that implements the Blob interface. The object returned initially contains no data.- Specified by:
createBlobin interfaceConnection- Returns:
- a MonetBlob instance
- Throws:
SQLException- - if an object that implements the Blob interface can not be constructed, this method is called on a closed connection or a database access error occurs.
-
createArrayOf
Arrays are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createStruct
Structs are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
createNClob
NClobs are not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
SQL XML is not yet currently supported. Throws SQLFeatureNotSupportedException.- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-