|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.idms.io.TraceObject ca.idms.jdbc.IdmsJdbcObject ca.idms.jdbc.IdmsConnection
public class IdmsConnection
Represents a JDBC connection with an IDMS database. Contains a main Session to support SQL requests and a TRANSIENT READ session for database metadata queries.
IdmsJdbcObject
,
IdmsJdbcDriver
,
IdmsStatement
,
IdmsPreparedStatement
,
IdmsCallableStatement
Field Summary | |
---|---|
static java.lang.String |
DICTIONARY
Key name that identifies the database in internal data source definitions. |
static java.lang.String |
RELOAD
Property name to enable refresh of options. |
static ca.idms.qcli.Sqlpib |
SQLPIB
SQL Program Information Block for CA_IDMS JDBC Driver. |
static java.lang.String |
TEMP_DSN
Identifies the "temporary data source" used when all connection information is specified in the DataSource object instead of using the configuration file. |
Fields inherited from class ca.idms.jdbc.IdmsJdbcObject |
---|
FAKE_METHODS, FAKE_SUPPORT, fakeSupport, MESSAGES |
Fields inherited from class ca.idms.io.TraceObject |
---|
exclude, EXCLUDE, FALSE, include, INCLUDE, logWriter, PREFIX, PROPERTIES_FILE, PROPERTIES_KEY, snap, SNAP, SNAP_BYTES, SNAP_NATIVE, SNAP_OBJECT, SNAP_SQL, snapBytes, snapNative, snapObject, snapSql, stub, trace, TRACE, TRACE_FILE, TRACE_LIFE, TRACE_NATIVE, TRACE_PRODUCT, traceLife, traceNative, traceStream, TRUE |
Fields inherited from interface java.sql.Connection |
---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Fields inherited from interface ca.idms.jdbc.IdmsDriverInterface |
---|
ACCOUNT, BATCH, CCIHOST, CCIPORT, CSUSPEND, CUSTOM, DEF_CCIPORT, DEF_TASK, DEFSCHEM, EWAIT, INFO, INTERACTIVE, NODE, PASSWORD, PROGRAM, RSINT, SBUFLEN, SERVICE, SSL, STRACE, SUSPEND, TASK, USER, VIA |
Fields inherited from interface ca.idms.qcli.SQLState |
---|
SQL_00000, SQL_01000, SQL_01004, SQL_07001, SQL_07009, SQL_08001, SQL_08002, SQL_08003, SQL_08004, SQL_08006, SQL_08007, SQL_0A000, SQL_21000, SQL_22000, SQL_22001, SQL_22003, SQL_22005, SQL_22007, SQL_24000, SQL_25000, SQL_3C000, SQL_40000, SQL_42000, SQL_HY000, SQL_HY004, SQL_HY009, SQL_HY010, SQL_HY024, SQL_HY106, SQL_HYC00 |
Method Summary | |
---|---|
void |
addCursorName(java.lang.String name)
Adds a name to the cursor name table to enforce uniqueness. |
void |
addStatement(IdmsStatement stmt)
Adds an object to the connection's statement table. |
void |
close()
Immediately releases a Connection's database and JDBC resources. |
void |
commit()
Commits the transaction. |
java.sql.Array |
createArrayOf(java.lang.String arg0,
java.lang.Object[] arg1)
IDMS does not support the ARRAY type. |
java.sql.Blob |
createBlob()
IDMS does not support the BLOB type. |
java.sql.Clob |
createClob()
IDMS does not support the CLOB type. |
java.sql.NClob |
createNClob()
IDMS does not support the NCLOB type. |
java.sql.SQLXML |
createSQLXML()
IDMS does not support the SQLMXL type. |
java.sql.Statement |
createStatement()
Creates an IDMS statement. |
java.sql.Statement |
createStatement(int type,
int conc)
Creates an CA IDMS Statement with the specified type and concurrency. |
java.sql.Statement |
createStatement(int type,
int conc,
int hold)
Creates an IDMS Statement with specified type, concurrency, and holdability. |
java.sql.Struct |
createStruct(java.lang.String arg0,
java.lang.Object[] arg1)
IDMS does not support the STRUCT type. |
protected void |
finalize()
Cleans up when the IDMS JDBC driver object goes away. |
protected java.lang.Object |
get(java.lang.reflect.Field f)
Allows the default snap method access to non-public variables. |
boolean |
getAutoCommit()
Get the current auto-commit mode. |
java.lang.String |
getCatalog()
Return the connection's CURRENT DATABASE name. |
java.util.Properties |
getClientInfo()
Returns the set of ClientInfo properties and their associated values. |
java.lang.String |
getClientInfo(java.lang.String s)
Returns the current value of a ClientInfo property, or null if the property doesn't exist. |
java.lang.Object[][] |
getClientInfoObjects()
Instantiates a clientInfo object if it doesn't already exist, then obtains an array of Object arrays which represent the name, maximum length, default value and description of all ClientInfo properties. |
int |
getHoldability()
Gets current ResultSet holdability for this connection. |
java.sql.DatabaseMetaData |
getMetaData()
Gets information about the connected database. |
int |
getTransactionIsolation()
Get this Connection's current transaction isolation level. |
java.util.Map<java.lang.String,java.lang.Class<?>> |
getTypeMap()
IDMS does not support user defined types. |
boolean |
isClosed()
Tests to see if a Connection is closed. |
boolean |
isGlobalTransaction()
Indicates that the transaction mode is global. |
boolean |
isPooledConnection()
Indicates a PooledConnection. |
boolean |
isReadOnly()
Tests to see if the connection is in read-only mode. |
boolean |
isTmgrSessionError(int sqlerc)
Indicates that a TMGR non-fatal session error. |
boolean |
isValid(int t)
Returns true if the connection has not been closed and is still valid. |
boolean |
isXAConnection()
Indicates an XAConnection. |
java.lang.String |
nativeSQL(java.lang.String sql)
Converts an SQL statement to the native CA IDMS grammar. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Prepares an IDMS procedure call. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int type,
int conc)
Prepares an IDMS CALL Statement with specified type and concurrency. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int type,
int conc,
int hold)
Prepares an IDMS CALL Statement with specified type, concurrency, and holdability. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Prepares an IDMS statement. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int key)
Prepares an IDMS statement. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int[] index)
Prepares an IDMS statement. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int type,
int conc)
Prepares an CA IDMS Statement with specified type and concurrency. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int type,
int conc,
int hold)
Prepares an IDMS Statement with specified type, concurrency, and holdability. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
java.lang.String[] names)
Prepares an IDMS statement. |
void |
releaseSavepoint(java.sql.Savepoint savepoint)
IDMS does does support Savepoints. |
void |
removeCursorName(java.lang.String name)
Removes a name from the cursor name table. |
void |
removeStatement(IdmsStatement stmt)
Removes an object from the connection's statement table. |
void |
resetClientInfo()
resets the ClientInfo properties, if they exist. |
void |
rollback()
Rolls back the transaction. |
void |
rollback(java.sql.Savepoint savepoint)
IDMS does does support Savepoints. |
void |
setAutoCommit(boolean autoCommit)
Enables or disables auto-commit mode. |
void |
setCatalog(java.lang.String catalog)
Satisfies Connection interface, this method does nothing. |
void |
setClientInfo(java.util.Properties p)
Sets ClientInfo properties to those passed by the application. |
void |
setClientInfo(java.lang.String k,
java.lang.String v)
Sets a ClientInfo property as requested by the application. |
void |
setHoldability(int opt)
Sets the current holdability for all ResultSets. |
void |
setIdentity()
Sends the external identity to CA IDMS. |
void |
setIdentity(java.lang.String id)
Sends an external identity to CA IDMS. |
void |
setReadOnly(boolean readOnly)
Enables or disables read-only mode. |
java.sql.Savepoint |
setSavepoint()
IDMS does does support Savepoints. |
java.sql.Savepoint |
setSavepoint(java.lang.String name)
IDMS does does support Savepoints. |
void |
setTransactionIsolation(int level)
Sets the transaction isolation level. |
void |
setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map)
IDMS does not support user defined types. |
void |
suspend()
Suspends the main and catalog connections. |
Methods inherited from class ca.idms.jdbc.IdmsJdbcObject |
---|
clearWarnings, getWarnings, hasCursor, hasUpdate, isStarted, isSuspended, isWrapperFor, notifyStatementError, unwrap |
Methods inherited from class ca.idms.io.TraceObject |
---|
getBoolean, getClasses, getInteger, getProperty, listProperties, message, parseList, print, print, print, println, println, snap, snap, snap, snap, snap, snap, snap, toHex, toHex, toHex, toHex, toHex, toString, trace, trace, trace, trace, trace, trace, traceEntry, unloadProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.Connection |
---|
clearWarnings, getWarnings |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Field Detail |
---|
public static final ca.idms.qcli.Sqlpib SQLPIB
public static final java.lang.String RELOAD
This allows options to be changed without recycling the application server. This can be useful to enable or disable the global trace. To enable it ddd this to the command that starts the Java VM:
-Dca.idms.reload=true
Or add this to the CA IDMS properties file (usually caidms.properties):
reload=true
Note that the reload setting itself is only checked when this class is initialized, so the only way to change it is to unload this class, which usually means recycling the application server.
public static final java.lang.String TEMP_DSN
public static final java.lang.String DICTIONARY
Method Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class TraceObject
java.lang.Throwable
- not really.protected java.lang.Object get(java.lang.reflect.Field f) throws java.lang.IllegalAccessException
get
in class IdmsJdbcObject
f
- a Field returned by Class.getDeclaredFields
java.lang.IllegalAccessException
- should not happenTraceObject.snap
,
TraceObject.snap()
public void close() throws java.sql.SQLException
java.sql.SQLException
- does not happen.public boolean isClosed() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.public java.sql.Statement createStatement() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
sql
- a SQL statement that may contain one or more '?' IN
parameter placeholders
java.sql.SQLException
- if a database error occurs.public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
sql
- a SQL statement that may contain a CALL command
java.sql.SQLException
- if a database error occurspublic java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
sql
- a SQL statement
java.sql.SQLException
- if a database error occurs.public void commit() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.setAutoCommit(boolean)
public void rollback() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.setAutoCommit(boolean)
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
catalog
- ignored.
java.sql.SQLException
- NOT!public java.lang.String getCatalog() throws java.sql.SQLException
Note that this can be a relatively expensive operation, since it executes a catalog query to get the actual database name the first time it is invoked. After that it returns the cached catalog name.
java.sql.SQLException
- if an error occurs.public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
That is the Sun javadoc, for CA IDMS the COMMIT is not issued when the cursor is closed if there are other open cursors.
autoCommit
- true enables auto-commit; false disables auto-commit.
java.sql.SQLException
- if a database error occurs.public boolean getAutoCommit() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.setAutoCommit(boolean)
public void setReadOnly(boolean readOnly) throws java.sql.SQLException
Note: setReadOnly cannot be called while in the middle of a transaction.
readOnly
- true enables read-only; false disables read-only.
java.sql.SQLException
- if a database error occurs.public boolean isReadOnly() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.public void setTransactionIsolation(int level) throws java.sql.SQLException
Note: setTransactionIsolation cannot be called while in the middle of a transaction.
level
- one of the TRANSACTION_* isolation values with the
exception of TRANSACTION_NONE; some databases may not support
other values
java.sql.SQLException
- if a database error occurs.public int getTransactionIsolation() throws java.sql.SQLException
java.sql.SQLException
- if a database error occurs.public java.sql.Statement createStatement(int type, int conc) throws java.sql.SQLException
This behavior conforms to the JDBC 4.0 Specification (JSR 221) and other documents written by the JDBC specification writers. Note that the Java 6 API specification (javadoc) indicates that the driver should throw an SQLFeatureNotSupportedException if the application requests an unsupported type or concurrency. This is inconsistent with JSR 221 and appears to be an implementation error.
type
- ResultSet typeconc
- ResultSet concurrency
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int type, int conc) throws java.sql.SQLException
createStatement(int, int)
.
sql
- SQL statement to preparetype
- ResultSet typeconc
- ResultSet concurrency
java.sql.SQLException
- if an error occurspublic java.sql.CallableStatement prepareCall(java.lang.String sql, int type, int conc) throws java.sql.SQLException
createStatement(int, int)
.
sql
- SQL statement to preparetype
- ResultSet typeconc
- ResultSet concurrency
java.sql.SQLException
- if an error occurspublic java.util.Map<java.lang.String,java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
java.sql.SQLException
- neverpublic void setTypeMap(java.util.Map<java.lang.String,java.lang.Class<?>> map) throws java.sql.SQLException
map
- the Map object, which we won't really use
java.sql.SQLException
- neverpublic void setHoldability(int opt) throws java.sql.SQLException
If CLOSE_CURSORS_AT_COMMIT is specified (the default), or there are no open cursors, a COMMIT is issued, closing all open cursors and deallocating all prepared statements. The syntax of prepared statements is cached, which allows them to be prepared again as necessary.
opt
- ResultSet holdability option
java.sql.SQLException
- if an invalid option is specifiedcreateStatement(int,int)
,
prepareStatement(String,int,int)
,
prepareCall(String,int,int)
public int getHoldability() throws java.sql.SQLException
java.sql.SQLException
- neversetHoldability(int)
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
java.sql.SQLException
- alwaysIdmsJdbcObject.fakeSupport
public java.sql.Savepoint setSavepoint(java.lang.String name) throws java.sql.SQLException
name
- Savepoint name
java.sql.SQLException
- alwaysIdmsJdbcObject.fakeSupport
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException
savepoint
- Savepoint object, ignored
java.sql.SQLException
- alwaysIdmsJdbcObject.fakeSupport
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException
savepoint
- Savepoint object, ignored
java.sql.SQLException
- alwaysIdmsJdbcObject.fakeSupport
public java.sql.Statement createStatement(int type, int conc, int hold) throws java.sql.SQLException
createStatement(int, int)
.
type
- ResultSet typeconc
- ResultSet concurrencyhold
- ResultSet holdability
java.sql.SQLException
- if an error occurssetHoldability(int)
,
createStatement(int, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int type, int conc, int hold) throws java.sql.SQLException
createStatement(int, int)
.
sql
- SQL statement to preparetype
- ResultSet typeconc
- ResultSet concurrencyhold
- ResultSet holdability, sets for all
java.sql.SQLException
- if an error occurssetHoldability(int)
public java.sql.CallableStatement prepareCall(java.lang.String sql, int type, int conc, int hold) throws java.sql.SQLException
createStatement(int, int)
.
sql
- SQL CALL statement to preparetype
- ResultSet typeconc
- ResultSet concurrencyhold
- ResultSet holdability, sets for all
java.sql.SQLException
- if an error occurssetHoldability(int)
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int key) throws java.sql.SQLException
prepareStatement(String)
. Calling
the statement's getAutogeneratedKeys will just return
an empty ResultSet.
sql
- SQL statementkey
- auto generated key flag, ignored
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, int[] index) throws java.sql.SQLException
prepareStatement(String)
. Calling
the statement's getAutogeneratedKeys will just return
an empty ResultSet.
sql
- SQL statementindex
- auto generated key ordinal array, ignored
java.sql.SQLException
- if an error occurspublic java.sql.PreparedStatement prepareStatement(java.lang.String sql, java.lang.String[] names) throws java.sql.SQLException
prepareStatement(String)
. Calling
the statement's getAutogeneratedKeys will just return
an empty ResultSet.
sql
- SQL statementnames
- auto generated key column name array, ignored
java.sql.SQLException
- if we can't do it or an error occurspublic java.sql.Array createArrayOf(java.lang.String arg0, java.lang.Object[] arg1) throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.sql.Blob createBlob() throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.sql.Clob createClob() throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.sql.NClob createNClob() throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.sql.SQLXML createSQLXML() throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.sql.Struct createStruct(java.lang.String arg0, java.lang.Object[] arg1) throws java.sql.SQLException
java.sql.SQLException
- alwayspublic java.util.Properties getClientInfo() throws java.sql.SQLException
java.sql.SQLException
- if connection is closedpublic java.lang.String getClientInfo(java.lang.String s) throws java.sql.SQLException
s
- the property key
java.sql.SQLException
- if connection is closedpublic boolean isValid(int t) throws java.sql.SQLException
t
- the number of seconds to wait for completion of the validating
query to the IDMS system.
java.sql.SQLException
- if the requested timeout value is less than zero.public void setClientInfo(java.util.Properties p) throws java.sql.SQLClientInfoException
p
- a collection of ClientInfo properties to be set.
java.sql.SQLClientInfoException
- - if one or more of the properties fails
to be set, or this method is called on a closed connection.public void setClientInfo(java.lang.String k, java.lang.String v) throws java.sql.SQLClientInfoException
k
- property keyv
- property value
java.sql.SQLClientInfoException
- - the property fails to be set.public void setIdentity(java.lang.String id) throws java.sql.SQLException
id
- the external user identity or null
java.sql.SQLException
- if an error occurs or an attempt is made
to override the identity set by the identity managersetIdentity()
public void setIdentity() throws java.sql.SQLException
java.sql.SQLException
- if an error occurspublic void addStatement(IdmsStatement stmt)
stmt
- the statement objectpublic void removeStatement(IdmsStatement stmt)
stmt
- the statement objectpublic void addCursorName(java.lang.String name) throws java.sql.SQLException
name
- the cursor name.
java.sql.SQLException
- if name is not unique.public void removeCursorName(java.lang.String name)
name
- the cursor name.public boolean isPooledConnection()
IdmsPooledConnection
public boolean isXAConnection()
IdmsXAConnection
public boolean isGlobalTransaction()
IdmsXAConnection
public boolean isTmgrSessionError(int sqlerc)
sqlerc
- SQL reason code from SQLCA
isTmgrSessionError(int)
public void suspend() throws java.sql.SQLException
java.sql.SQLException
IdmsLogicalConnection.close()
public java.lang.Object[][] getClientInfoObjects()
IdmsDatabaseMetaData.getClientInfoProperties()
public void resetClientInfo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |