Package SQLite.JDBC2z

Class JDBCConnection

java.lang.Object
SQLite.JDBC2z.JDBCConnection
All Implemented Interfaces:
AutoCloseable, Connection, Wrapper, BusyHandler

public class JDBCConnection
extends Object
implements Connection, BusyHandler
  • Field Details

    • db

      protected SQLite.JDBC2z.DatabaseX db
      Open database.
    • url

      protected String url
      Database URL.
    • enc

      protected String enc
      Character encoding.
    • vfs

      protected String vfs
      SQLite 3 VFS to use.
    • autocommit

      protected boolean autocommit
      Autocommit flag, true means autocommit.
    • intrans

      protected boolean intrans
      In-transaction flag. Can be true only when autocommit false.
    • timeout

      protected int timeout
      Timeout for Database.exec()
    • useJulian

      protected boolean useJulian
      Use double/julian date representation.
  • Constructor Details

  • Method Details

    • busy

      public boolean busy​(String table, int count)
      Description copied from interface: BusyHandler
      Invoked when a table is locked by another process or thread. The method should return true for waiting until the table becomes unlocked, or false in order to abandon the action.

      Specified by:
      busy in interface BusyHandler
      Parameters:
      table - the name of the locked table
      count - number of times the table was locked
    • busy3

      protected boolean busy3​(SQLite.JDBC2z.DatabaseX db, int count)
    • getSQLiteDatabase

      public Database getSQLiteDatabase()
    • createStatement

      public Statement createStatement()
      Description copied from interface: Connection
      Returns a new instance of Statement for issuing SQL commands to the remote database.

      ResultSets generated by the returned statement will default to type ResultSet.TYPE_FORWARD_ONLY and concurrency level ResultSet.CONCUR_READ_ONLY.

      Specified by:
      createStatement in interface Connection
      Returns:
      a Statement object with default settings.
      See Also:
      ResultSet
    • createStatement

      public Statement createStatement​(int resultSetType, int resultSetConcurrency) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of Statement whose associated ResultSets have the characteristics specified in the type and concurrency arguments.
      Specified by:
      createStatement in interface Connection
      Parameters:
      resultSetType - one of the following type specifiers:
      resultSetConcurrency - one of the following concurrency mode specifiers:
      Returns:
      a new instance of Statement capable of manufacturing ResultSets that satisfy the specified resultSetType and resultSetConcurrency values.
      Throws:
      SQLException - if there is a problem accessing the database
    • getMetaData

      public DatabaseMetaData getMetaData() throws SQLException
      Description copied from interface: Connection
      Gets the metadata about the database referenced by this connection. The returned DatabaseMetaData describes the database topography, available stored procedures, SQL syntax and so on.
      Specified by:
      getMetaData in interface Connection
      Returns:
      a DatabaseMetaData object containing the database description.
      Throws:
      SQLException - if there is a problem accessing the a database.
    • close

      public void close() throws SQLException
      Description copied from interface: Connection
      Causes the instant release of all database and driver connection resources associated with this object. Any subsequent invocations of this method have no effect.

      It is strongly recommended that all connections are closed before they are dereferenced by the application ready for garbage collection. Although the finalize method of the connection closes the connection before garbage collection takes place, it is not advisable to leave the close operation to take place in this way. Mainly because undesired side-effects may appear.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Connection
      Throws:
      SQLException - if there is a problem accessing the database.
    • isClosed

      public boolean isClosed() throws SQLException
      Description copied from interface: Connection
      Returns a boolean indicating whether or not this connection is in the closed state. The closed state may be entered into as a consequence of a successful invocation of the Connection.close() method or else if an error has occurred that prevents the connection from functioning normally.
      Specified by:
      isClosed in interface Connection
      Returns:
      true if closed, otherwise false.
      Throws:
      SQLException - if there is a problem accessing the database.
    • isReadOnly

      public boolean isReadOnly() throws SQLException
      Description copied from interface: Connection
      Returns a boolean indicating whether or not this connection is currently in the read-only state.
      Specified by:
      isReadOnly in interface Connection
      Returns:
      true if in read-only state, otherwise false.
      Throws:
      SQLException - if there is a problem accessing the database.
    • clearWarnings

      public void clearWarnings() throws SQLException
      Description copied from interface: Connection
      Discards all warnings that may have arisen for this connection. Subsequent calls to Connection.getWarnings() will return null up until a new warning condition occurs.
      Specified by:
      clearWarnings in interface Connection
      Throws:
      SQLException - if there is a problem accessing the database.
    • commit

      public void commit() throws SQLException
      Description copied from interface: Connection
      Commits all of the changes made since the last commit or rollback of the associated transaction. All locks in the database held by this connection are also relinquished. Calling this operation on connection objects in auto-commit mode leads to an error.
      Specified by:
      commit in interface Connection
      Throws:
      SQLException - if there is a problem accessing the database or if the target connection instance is in auto-commit mode.
    • getAutoCommit

      public boolean getAutoCommit() throws SQLException
      Description copied from interface: Connection
      Returns a boolean indicating whether or not this connection is in the auto-commit operating mode.
      Specified by:
      getAutoCommit in interface Connection
      Returns:
      true if auto-commit is on, otherwise false.
      Throws:
      SQLException - if there is a problem accessing the database.
    • getCatalog

      public String getCatalog() throws SQLException
      Description copied from interface: Connection
      Gets this Connection object's current catalog name.
      Specified by:
      getCatalog in interface Connection
      Returns:
      the catalog name. null if there is no catalog name.
      Throws:
      SQLException - if there is a problem accessing the database.
    • getTransactionIsolation

      public int getTransactionIsolation() throws SQLException
      Description copied from interface: Connection
      Returns the transaction isolation level for this connection.
      Specified by:
      getTransactionIsolation in interface Connection
      Returns:
      the transaction isolation value.
      Throws:
      SQLException - if there is a problem accessing the database.
      See Also:
      Connection.TRANSACTION_NONE, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_REPEATABLE_READ, Connection.TRANSACTION_SERIALIZABLE
    • getWarnings

      public SQLWarning getWarnings() throws SQLException
      Description copied from interface: Connection
      Gets the first instance of any SQLWarning objects that may have been created in the use of this connection. If at least one warning has occurred then this operation returns the first one reported. A null indicates that no warnings have occurred.

      By invoking the SQLWarning.getNextWarning() method of the returned SQLWarning object it is possible to obtain all of this connection's warning objects.

      Specified by:
      getWarnings in interface Connection
      Returns:
      the first warning as an SQLWarning object (may be null).
      Throws:
      SQLException - if there is a problem accessing the database or if the call has been made on a connection which has been previously closed.
    • nativeSQL

      public String nativeSQL​(String sql) throws SQLException
      Description copied from interface: Connection
      Returns a string representation of the input SQL statement sql expressed in the underlying system's native SQL syntax.
      Specified by:
      nativeSQL in interface Connection
      Parameters:
      sql - the JDBC form of an SQL statement.
      Returns:
      the SQL statement in native database format.
      Throws:
      SQLException - if there is a problem accessing the database
    • prepareCall

      public CallableStatement prepareCall​(String sql) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of CallableStatement that may be used for making stored procedure calls to the database.
      Specified by:
      prepareCall in interface Connection
      Parameters:
      sql - the SQL statement that calls the stored function
      Returns:
      a new instance of CallableStatement representing the SQL statement. ResultSets emitted from this CallableStatement will default to type ResultSet.TYPE_FORWARD_ONLY and concurrency ResultSet.CONCUR_READ_ONLY.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • prepareCall

      public CallableStatement prepareCall​(String sql, int x, int y) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of CallableStatement that may be used for making stored procedure calls to the database. ResultSets emitted from this CallableStatement will satisfy the specified resultSetType and resultSetConcurrency values.
      Specified by:
      prepareCall in interface Connection
      Parameters:
      sql - the SQL statement
      x - one of the following type specifiers:
      y - one of the following concurrency mode specifiers:
      Returns:
      a new instance of CallableStatement representing the precompiled SQL statement. ResultSets emitted from this CallableStatement will satisfy the specified resultSetType and resultSetConcurrency values.
      Throws:
      SQLException - if a problem occurs accessing the database
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of PreparedStatement that may be used any number of times to execute parameterized requests on the database server.

      Subject to JDBC driver support, this operation will attempt to send the precompiled version of the statement to the database. If the driver does not support precompiled statements, the statement will not reach the database server until it is executed. This distinction determines the moment when SQLExceptions get raised.

      By default, ResultSets from the returned object will be ResultSet.TYPE_FORWARD_ONLY type with a ResultSet.CONCUR_READ_ONLY mode of concurrency.

      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement.
      Returns:
      the PreparedStatement containing the supplied SQL statement.
      Throws:
      SQLException - if there is a problem accessing the database.
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
      Description copied from interface: Connection
      Creates a PreparedStatement that generates ResultSets with the specified values of resultSetType and resultSetConcurrency.
      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement. It can contain one or more '?' IN parameter placeholders.
      resultSetType - one of the following type specifiers:
      resultSetConcurrency - one of the following concurrency mode specifiers:
      Returns:
      a new instance of PreparedStatement containing the SQL statement sql. ResultSets emitted from this PreparedStatement will satisfy the specified resultSetType and resultSetConcurrency values.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • rollback

      public void rollback() throws SQLException
      Description copied from interface: Connection
      Rolls back all updates made so far in this transaction and relinquishes all acquired database locks. It is an error to invoke this operation when in auto-commit mode.
      Specified by:
      rollback in interface Connection
      Throws:
      SQLException - if there is a problem with the database or if the method is called while in auto-commit mode of operation.
    • setAutoCommit

      public void setAutoCommit​(boolean ac) throws SQLException
      Description copied from interface: Connection
      Sets this connection's auto-commit mode on or off.

      Putting a Connection into auto-commit mode means that all associated SQL statements are run and committed as separate transactions. By contrast, setting auto-commit to off means that associated SQL statements get grouped into transactions that need to be completed by explicit calls to either the Connection.commit() or Connection.rollback() methods.

      Auto-commit is the default mode for new connection instances.

      When in this mode, commits will automatically occur upon successful SQL statement completion or upon successful completion of an execute. Statements are not considered successfully completed until all associated ResultSets and output parameters have been obtained or closed.

      Calling this operation during an uncommitted transaction will result in it being committed.

      Specified by:
      setAutoCommit in interface Connection
      Parameters:
      ac - boolean indication of whether to put the target connection into auto-commit mode (true) or not ( false).
      Throws:
      SQLException - if there is a problem accessing the database.
    • setCatalog

      public void setCatalog​(String catalog) throws SQLException
      Description copied from interface: Connection
      Sets the catalog name for this connection. This is used to select a subspace of the database for future work. If the driver does not support catalog names, this method is ignored.
      Specified by:
      setCatalog in interface Connection
      Parameters:
      catalog - the catalog name to use.
      Throws:
      SQLException - if there is a problem accessing the database.
    • setReadOnly

      public void setReadOnly​(boolean ro) throws SQLException
      Description copied from interface: Connection
      Sets this connection to read-only mode.

      This serves as a hint to the driver, which can enable database optimizations.

      Specified by:
      setReadOnly in interface Connection
      Parameters:
      ro - true to set the Connection to read only mode. false disables read-only mode.
      Throws:
      SQLException - if there is a problem accessing the database.
    • setTransactionIsolation

      public void setTransactionIsolation​(int level) throws SQLException
      Description copied from interface: Connection
      Sets the transaction isolation level for this Connection.

      If this method is called during a transaction, the results are implementation defined.

      Specified by:
      setTransactionIsolation in interface Connection
      Parameters:
      level - the new transaction isolation level to use from the following list of possible values:
      Throws:
      SQLException - if there is a problem with the database or if the value of level is not one of the expected constant values.
    • getTypeMap

      public Map<String,​Class<?>> getTypeMap() throws SQLException
      Description copied from interface: Connection
      Returns the type mapping associated with this Connection object. The type mapping must be set on the application level.
      Specified by:
      getTypeMap in interface Connection
      Returns:
      the Type Map as a java.util.Map.
      Throws:
      SQLException - if there is a problem accessing the database.
    • setTypeMap

      public void setTypeMap​(Map map) throws SQLException
      Description copied from interface: Connection
      Sets the TypeMap for this connection. The input map should contain mappings between complex Java and SQL types.
      Specified by:
      setTypeMap in interface Connection
      Parameters:
      map - the new type map.
      Throws:
      SQLException - if there is a problem accessing the database or if map is not an instance of Map.
    • getHoldability

      public int getHoldability() throws SQLException
      Description copied from interface: Connection
      Returns the holdability property that any ResultSet produced by this instance will have.
      Specified by:
      getHoldability in interface Connection
      Returns:
      one of the following holdability mode specifiers:
      Throws:
      SQLException - if there is a problem accessing the a database.
    • setHoldability

      public void setHoldability​(int holdability) throws SQLException
      Description copied from interface: Connection
      Sets the holdability of the ResultSets created by this Connection.
      Specified by:
      setHoldability in interface Connection
      Parameters:
      holdability - one of the following holdability mode specifiers:
      Throws:
      SQLException - if there is a problem accessing the database
    • setSavepoint

      public Savepoint setSavepoint() throws SQLException
      Description copied from interface: Connection
      Creates an unnamed Savepoint in the current transaction.
      Specified by:
      setSavepoint in interface Connection
      Returns:
      a Savepoint object for this savepoint.
      Throws:
      SQLException - if there is a problem accessing the database.
    • setSavepoint

      public Savepoint setSavepoint​(String name) throws SQLException
      Description copied from interface: Connection
      Creates a named Savepoint in the current transaction.
      Specified by:
      setSavepoint in interface Connection
      Parameters:
      name - the name to use for the new Savepoint.
      Returns:
      a Savepoint object for this savepoint.
      Throws:
      SQLException - if there is a problem accessing the database.
    • rollback

      public void rollback​(Savepoint x) throws SQLException
      Description copied from interface: Connection
      Undoes all changes made after the supplied Savepoint object was set. This method should only be used when auto-commit mode is disabled.
      Specified by:
      rollback in interface Connection
      Parameters:
      x - the Savepoint to roll back to
      Throws:
      SQLException - if there is a problem accessing the database.
    • releaseSavepoint

      public void releaseSavepoint​(Savepoint x) throws SQLException
      Description copied from interface: Connection
      Releases the specified savepoint from the present transaction. Once removed, the Savepoint is considered invalid and should not be referenced further.
      Specified by:
      releaseSavepoint in interface Connection
      Parameters:
      x - the object targeted for removal.
      Throws:
      SQLException - if there is a problem with accessing the database or if savepoint is considered not valid in this transaction.
    • createStatement

      public Statement createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of Statement whose associated ResultSets will have the characteristics specified in the type, concurrency and holdability arguments.
      Specified by:
      createStatement in interface Connection
      Parameters:
      resultSetType - one of the following type specifiers:
      resultSetConcurrency - one of the following concurrency mode specifiers:
      resultSetHoldability - one of the following holdability mode specifiers:
      Returns:
      a new instance of Statement capable of manufacturing ResultSets that satisfy the specified resultSetType, resultSetConcurrency and resultSetHoldability values.
      Throws:
      SQLException - if there is a problem accessing the database.
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
      Description copied from interface: Connection
      Creates a PreparedStatement that generates ResultSets with the specified type, concurrency and holdability
      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement. It can contain one or more '?' IN parameter placeholders.
      resultSetType - one of the following type specifiers:
      resultSetConcurrency - one of the following concurrency mode specifiers:
      resultSetHoldability - one of the following holdability mode specifiers:
      Returns:
      a new instance of PreparedStatement containing the SQL statement sql. ResultSets emitted from this PreparedStatement will satisfy the specified resultSetType, resultSetConcurrency and resultSetHoldability values.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • prepareCall

      public CallableStatement prepareCall​(String sql, int x, int y, int z) throws SQLException
      Description copied from interface: Connection
      Returns a new instance of CallableStatement that may be used for making stored procedure calls to the database. ResultSets created from this CallableStatement will have characteristics determined by the specified type, concurrency and holdability arguments.
      Specified by:
      prepareCall in interface Connection
      Parameters:
      sql - the SQL statement
      x - one of the following type specifiers:
      y - one of the following concurrency mode specifiers:
      z - one of the following holdability mode specifiers:
      Returns:
      a new instance of CallableStatement representing the precompiled SQL statement. ResultSets emitted from this CallableStatement will satisfy the specified resultSetType, resultSetConcurrency and resultSetHoldability values.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql, int autokeys) throws SQLException
      Description copied from interface: Connection
      Creates a default PreparedStatement that can retrieve automatically generated keys. Parameter autoGeneratedKeys may be used to tell the driver whether such keys should be made accessible. This is only relevant when the sql statement is an insert statement.

      An SQL statement which may have IN parameters can be stored and precompiled in a PreparedStatement. The PreparedStatement can then be then be used to execute the statement multiple times in an efficient way.

      Subject to JDBC driver support, this operation will attempt to send the precompiled version of the statement to the database. If the driver does not support precompiled statements, the statement will not reach the database server until it is executed. This distinction determines the moment when SQLExceptions get raised.

      By default, ResultSets from the returned object will be ResultSet.TYPE_FORWARD_ONLY type with a ResultSet.CONCUR_READ_ONLY mode of concurrency.

      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement.
      autokeys - one of the following generated key options:
      Returns:
      a new PreparedStatement instance representing the input SQL statement.
      Throws:
      SQLException - if there is a problem accessing the database.
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql, int[] colIndexes) throws SQLException
      Description copied from interface: Connection
      Creates a default PreparedStatement that can retrieve the auto-generated keys designated by a supplied array. If sql is an SQL INSERT statement, the parameter columnIndexes is expected to hold the index values for each column in the statement's intended database table containing the autogenerated-keys of interest. Otherwise columnIndexes is ignored.

      Subject to JDBC driver support, this operation will attempt to send the precompiled version of the statement to the database. If the driver does not support precompiled statements, the statement will not reach the database server until it is executed. This distinction determines the moment when SQLExceptions get raised.

      By default, ResultSets from the returned object will be ResultSet.TYPE_FORWARD_ONLY type with a ResultSet.CONCUR_READ_ONLY concurrency mode.

      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement.
      colIndexes - the indexes of the columns for which auto-generated keys should be made available.
      Returns:
      the PreparedStatement containing the supplied SQL statement.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • prepareStatement

      public PreparedStatement prepareStatement​(String sql, String[] columns) throws SQLException
      Description copied from interface: Connection
      Creates a default PreparedStatement that can retrieve the auto-generated keys designated by a supplied array. If sql is an SQL INSERT statement, columnNames is expected to hold the names of each column in the statement's associated database table containing the autogenerated-keys of interest. Otherwise columnNames is ignored.

      Subject to JDBC driver support, this operation will attempt to send the precompiled version of the statement to the database. Alternatively, if the driver is not capable of handling precompiled statements, the statement will not reach the database server until it is executed. This will have a bearing on precisely when SQLException instances get raised.

      By default, ResultSets from the returned object will be ResultSet.TYPE_FORWARD_ONLY type with a ResultSet.CONCUR_READ_ONLY concurrency mode.

      Specified by:
      prepareStatement in interface Connection
      Parameters:
      sql - the SQL statement.
      columns - the names of the columns for which auto-generated keys should be made available.
      Returns:
      the PreparedStatement containing the supplied SQL statement.
      Throws:
      SQLException - if a problem occurs accessing the database.
    • createClob

      public Clob createClob() throws SQLException
      Description copied from interface: Connection
      Returns a new empty Clob.
      Specified by:
      createClob in interface Connection
      Throws:
      SQLException - if this connection is closed, or there's a problem creating a new clob.
    • createBlob

      public Blob createBlob() throws SQLException
      Description copied from interface: Connection
      Returns a new empty Blob.
      Specified by:
      createBlob in interface Connection
      Throws:
      SQLException - if this connection is closed, or there's a problem creating a new blob.
    • createNClob

      public NClob createNClob() throws SQLException
      Description copied from interface: Connection
      Returns a new empty NClob.
      Specified by:
      createNClob in interface Connection
      Throws:
      SQLException - if this connection is closed, or there's a problem creating a new nclob.
    • createSQLXML

      public SQLXML createSQLXML() throws SQLException
      Description copied from interface: Connection
      Returns a new empty SQLXML.
      Specified by:
      createSQLXML in interface Connection
      Throws:
      SQLException - if this connection is closed, or there's a problem creating a new XML.
    • isValid

      public boolean isValid​(int timeout) throws SQLException
      Description copied from interface: Connection
      Returns true if this connection is still open and valid, false otherwise.
      Specified by:
      isValid in interface Connection
      Parameters:
      timeout - number of seconds to wait for a response before giving up and returning false, 0 to wait forever
      Throws:
      SQLException - if timeout < 0
    • setClientInfo

      public void setClientInfo​(String name, String value) throws SQLClientInfoException
      Description copied from interface: Connection
      Sets the client info property name to value. A value of null clears the client info property.
      Specified by:
      setClientInfo in interface Connection
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem setting the property.
    • setClientInfo

      public void setClientInfo​(Properties prop) throws SQLClientInfoException
      Description copied from interface: Connection
      Replaces all client info properties with the name/value pairs from properties. All existing properties are removed. If an exception is thrown, the resulting state of this connection's client info properties is undefined.
      Specified by:
      setClientInfo in interface Connection
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem setting a property.
    • getClientInfo

      public String getClientInfo​(String name) throws SQLException
      Description copied from interface: Connection
      Returns the value corresponding to the given client info property, or null if unset.
      Specified by:
      getClientInfo in interface Connection
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem getting the property.
      SQLException
    • getClientInfo

      public Properties getClientInfo() throws SQLException
      Description copied from interface: Connection
      Returns a Properties object containing all client info properties.
      Specified by:
      getClientInfo in interface Connection
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem getting a property.
      SQLException
    • createArrayOf

      public Array createArrayOf​(String type, Object[] elems) throws SQLException
      Description copied from interface: Connection
      Returns a new Array containing the given elements.
      Specified by:
      createArrayOf in interface Connection
      Parameters:
      type - the SQL name of the type of the array elements
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem creating the array.
      SQLException
    • createStruct

      public Struct createStruct​(String type, Object[] attrs) throws SQLException
      Description copied from interface: Connection
      Returns a new Struct containing the given attributes.
      Specified by:
      createStruct in interface Connection
      Parameters:
      type - the SQL name of the type of the struct attributes
      Throws:
      SQLClientInfoException - if this connection is closed, or there's a problem creating the array.
      SQLException
    • unwrap

      public <T> T unwrap​(Class<T> iface) throws SQLException
      Description copied from interface: Wrapper
      Returns an object that implements the given interface. If the caller is not a wrapper, a SQLException will be thrown.
      Specified by:
      unwrap in interface Wrapper
      Parameters:
      iface - - the class that defines the interface
      Returns:
      - an object that implements the interface
      Throws:
      SQLException - - if there is no object implementing the specific interface
    • isWrapperFor

      public boolean isWrapperFor​(Class iface) throws SQLException
      Description copied from interface: Wrapper
      If the caller is a wrapper of the class or implements the given interface, the methods return false and vice versa.
      Specified by:
      isWrapperFor in interface Wrapper
      Parameters:
      iface - - the class that defines the interface
      Returns:
      - true if the instance implements the interface
      Throws:
      SQLException - - when an error occurs when judges the object