com.wrq.apptrieve.jdbc
Class ApptrieveConnection

java.lang.Object
  extended by com.wrq.apptrieve.jdbc.ApptrieveConnection
All Implemented Interfaces:
java.sql.Connection

public class ApptrieveConnection
extends java.lang.Object
implements java.sql.Connection


Field Summary
 
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
Method Summary
 void clearWarnings()
          Clears warnings for this connection
 void close()
          Closes the database connection.
 void commit()
          The Host Integrator JDBC Driver does not support commit.
 java.sql.Statement createStatement()
          Creates an ApptrieveStatement object for this connection.
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency)
          This method is not supported by the Host Integrator driver.
 java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          This method is not supported by the Host Integrator driver.
protected  void finalize()
          Performs final cleanup for this object
 boolean getAutoCommit()
          Determines the auto-commit state of the connection.
 java.lang.String getCatalog()
          The Host Integrator Driver does not support catalogs.
 int getHoldability()
          This method is not supported by the Host Integrator driver.
 java.sql.DatabaseMetaData getMetaData()
          Gets the database metadata object for this connection
 int getTransactionIsolation()
          Retrieves the transaction isolation level for the connection.
 java.util.Map getTypeMap()
          This method is not supported by the Host Integrator driver.
 java.sql.SQLWarning getWarnings()
          The Host Integrator Driver does not support Warnings.
 boolean isClosed()
          Lets others know the connection status.
 boolean isReadOnly()
          This method is not supported by the Host Integrator driver.
 java.lang.String nativeSQL(java.lang.String sql)
          Converts an SQL query into DBMS native format.
 java.sql.CallableStatement prepareCall(java.lang.String sql)
          Creates a stored procedure call.
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency)
          This method is not supported by the Host Integrator driver.
 java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          This method is not supported by the Host Integrator driver.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql)
          Returns an SQL pre-compiled statement.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int autoGeneratedKeys)
          This method is not supported by the Host Integrator driver.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] columnIndexes)
          This method is not supported by the Host Integrator driver.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency)
          This method is not supported by the Host Integrator driver.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          This method is not supported by the Host Integrator driver.
 java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] columnNames)
          This method is not supported by the Host Integrator driver.
 void releaseSavepoint(java.sql.Savepoint savepoint)
          This method is not supported by the Host Integrator driver.
 void rollback()
          The Host Integrator JDBC Driver does not support transaction rollback.
 void rollback(java.sql.Savepoint savepoint)
          The Host Integrator JDBC Driver does not support transaction rollback.
 void setAutoCommit(boolean autoCommit)
          The Host Integrator JDBC Driver does not support commit.
 void setCatalog(java.lang.String newcatalog)
          The Host Integrator JDBC Driver does not support catalogs.
 void setHoldability(int holdability)
          This method is not supported by the Host Integrator driver.
 void setReadOnly(boolean readOnly)
          The Host Integrator JDBC Driver does not support readOnly parameter.
 java.sql.Savepoint setSavepoint()
          This method is not supported by the Host Integrator driver.
 java.sql.Savepoint setSavepoint(java.lang.String name)
          This method is not supported by the Host Integrator driver.
 void setTransactionIsolation(int level)
          This has no meaning to Host Integrator Driver, which is always TRANSACTION_NONE.
 void setTypeMap(java.util.Map map)
          This method is not supported by the Host Integrator driver.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clearWarnings

public void clearWarnings()
Clears warnings for this connection

Specified by:
clearWarnings in interface java.sql.Connection
See Also:
Connection.clearWarnings()

close

public void close()
           throws java.sql.SQLException
Closes the database connection.

Specified by:
close in interface java.sql.Connection
Throws:
java.sql.SQLException - thrown in the event of any errors.
See Also:
Connection.close()

commit

public void commit()
            throws java.sql.SQLException
The Host Integrator JDBC Driver does not support commit.

Specified by:
commit in interface java.sql.Connection
Throws:
java.sql.SQLException
See Also:
Connection.commit()

createStatement

public java.sql.Statement createStatement()
                                   throws java.sql.SQLException
Creates an ApptrieveStatement object for this connection.

Specified by:
createStatement in interface java.sql.Connection
Returns:
java.sql.Statement object
Throws:
java.sql.SQLException
See Also:
Connection.createStatement()

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency)
                                   throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.createStatement(int, int)

createStatement

public java.sql.Statement createStatement(int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
createStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.createStatement(int, int, int)

getAutoCommit

public boolean getAutoCommit()
                      throws java.sql.SQLException
Determines the auto-commit state of the connection.

Specified by:
getAutoCommit in interface java.sql.Connection
Returns:
boolean - true since autocommit is implicit
Throws:
java.sql.SQLException
See Also:
Connection.getAutoCommit()

getCatalog

public java.lang.String getCatalog()
                            throws java.sql.SQLException
The Host Integrator Driver does not support catalogs.

Specified by:
getCatalog in interface java.sql.Connection
Returns:
java.lang.String - the catalog
Throws:
java.sql.SQLException
See Also:
Connection.getCatalog()

getHoldability

public int getHoldability()
                   throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
getHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.getHoldability()

getMetaData

public java.sql.DatabaseMetaData getMetaData()
                                      throws java.sql.SQLException
Gets the database metadata object for this connection

Specified by:
getMetaData in interface java.sql.Connection
Returns:
DatabaseMetaData object
Throws:
java.sql.SQLException
See Also:
Connection.getMetaData()

getTransactionIsolation

public int getTransactionIsolation()
                            throws java.sql.SQLException
Retrieves the transaction isolation level for the connection. This information has no meaning to Host Integrator.

Specified by:
getTransactionIsolation in interface java.sql.Connection
Returns:
the transaction isolation level
Throws:
java.sql.SQLException
See Also:
Connection.getTransactionIsolation()

getTypeMap

public java.util.Map getTypeMap()
                         throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
getTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.getTypeMap()

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
The Host Integrator Driver does not support Warnings.

Specified by:
getWarnings in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.getWarnings()

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Lets others know the connection status.

Specified by:
isClosed in interface java.sql.Connection
Returns:
true if the connection is closed, false otherwise
Throws:
java.sql.SQLException
See Also:
Connection.isClosed()

isReadOnly

public boolean isReadOnly()
                   throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
isReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.isReadOnly()

nativeSQL

public java.lang.String nativeSQL(java.lang.String sql)
                           throws java.sql.SQLException
Converts an SQL query into DBMS native format. For Apptrieve, no translation is performed

Specified by:
nativeSQL in interface java.sql.Connection
Parameters:
sql - java.lang.String - the query which just returned to the caller
Returns:
java.lang.String - the SQL string
Throws:
java.sql.SQLException
See Also:
Connection.nativeSQL(java.lang.String)

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql)
                                       throws java.sql.SQLException
Creates a stored procedure call.

The call escape for this method is:
{call procedureName(?, ?, ?, ?, ?, ?)}
Where procedureName is a procedure defined in an Host Integrator table. The call parameters are defined as follows, in order that they appear in the call escape:

  1. table name - a java.lang.String that contains the Host Integrator table in which defines the procedure (required and may not be null)
  2. data input values - a java.util.Map object that contains any data input name-value pairs for the procedure (not required and may be null)
  3. filter values - a java.util.Map object that contains any filter name-value pairs for the procedure (not required and may be null)
  4. filter is case sensitive flag - a Boolean object that sets whether or not the filter should be case sensitive (not required and may be null)
  5. output columns - a java.util.List object that contains a list of java.lang.String objects, each of which is a column to return in the output result. The default is to return all output columns defined for the procedure. (not required and may be null)
  6. maximum rows - an integer that set the maximum number of rows to return in the result. The default is to return all available rows, which is the same as setting this parameter to 0. (not required)

Specified by:
prepareCall in interface java.sql.Connection
Parameters:
sql - java.lang.String - the sql to use in creating a stored procedure call
Returns:
CallableStatement object for the created stored procedure
Throws:
java.sql.SQLException
See Also:
Connection.prepareCall(java.lang.String)

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
                                       throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.prepareCall(String, int, int)

prepareCall

public java.sql.CallableStatement prepareCall(java.lang.String sql,
                                              int resultSetType,
                                              int resultSetConcurrency,
                                              int resultSetHoldability)
                                       throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareCall in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.prepareCall(String, int, int, int)

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql)
                                            throws java.sql.SQLException
Returns an SQL pre-compiled statement. Note that Host Integrator server does not support precompiled statement. The Host Integrator JDBC Driver just maps a PreparedStatement to a regular Statement.

Specified by:
prepareStatement in interface java.sql.Connection
Parameters:
sql - java.lang.String - the query to use in creating the pre-compiled statement
Returns:
PreparedStatement object
Throws:
java.sql.SQLException - gets thrown any time this is called
See Also:
Connection.prepareStatement(java.lang.String)

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int autoGeneratedKeys)
                                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.prepareStatement(String, int)

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int[] columnIndexes)
                                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.prepareStatement(String, int[])

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency)
                                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.prepareStatement(String, int, int)

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   int resultSetType,
                                                   int resultSetConcurrency,
                                                   int resultSetHoldability)
                                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.prepareStatement(String, int, int, int)

prepareStatement

public java.sql.PreparedStatement prepareStatement(java.lang.String sql,
                                                   java.lang.String[] columnNames)
                                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
prepareStatement in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.prepareStatement(String, String[])

releaseSavepoint

public void releaseSavepoint(java.sql.Savepoint savepoint)
                      throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
releaseSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.releaseSavepoint(Savepoint)

rollback

public void rollback()
              throws java.sql.SQLException
The Host Integrator JDBC Driver does not support transaction rollback.

Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.rollback()

rollback

public void rollback(java.sql.Savepoint savepoint)
              throws java.sql.SQLException
The Host Integrator JDBC Driver does not support transaction rollback.

Specified by:
rollback in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.rollback(Savepoint)

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws java.sql.SQLException
The Host Integrator JDBC Driver does not support commit.

Specified by:
setAutoCommit in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setAutoCommit(boolean)

setCatalog

public void setCatalog(java.lang.String newcatalog)
                throws java.sql.SQLException
The Host Integrator JDBC Driver does not support catalogs. It does remember a catalog set via this method, however, and returns it via getCatalog() method.

Specified by:
setCatalog in interface java.sql.Connection
Parameters:
newcatalog - java.lang.String - the new catalog to set
Throws:
java.sql.SQLException
See Also:
Connection.setCatalog(java.lang.String)

setHoldability

public void setHoldability(int holdability)
                    throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
setHoldability in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setHoldability(int)

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws java.sql.SQLException
The Host Integrator JDBC Driver does not support readOnly parameter.

Specified by:
setReadOnly in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown.
See Also:
Connection.setReadOnly(boolean)

setSavepoint

public java.sql.Savepoint setSavepoint()
                                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setSavepoint()

setSavepoint

public java.sql.Savepoint setSavepoint(java.lang.String name)
                                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
setSavepoint in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setSavepoint(String)

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws java.sql.SQLException
This has no meaning to Host Integrator Driver, which is always TRANSACTION_NONE.

Specified by:
setTransactionIsolation in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setTransactionIsolation(int)

setTypeMap

public void setTypeMap(java.util.Map map)
                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
setTypeMap in interface java.sql.Connection
Throws:
java.sql.SQLException - - always thrown
See Also:
Connection.setTypeMap(Map)

finalize

protected void finalize()
                 throws java.lang.Throwable
Performs final cleanup for this object

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable