ca.idms.jdbc
Class IdmsResultObject

java.lang.Object
  extended by ca.idms.io.TraceObject
      extended by ca.idms.jdbc.IdmsJdbcObject
          extended by ca.idms.jdbc.IdmsResultObject
All Implemented Interfaces:
Trace, SQLState
Direct Known Subclasses:
IdmsResultSet, IdmsStatement

public abstract class IdmsResultObject
extends IdmsJdbcObject

Common base class for the Statement and ResultSet implementations. This class contains common variables and methods, most of which are related to attributes of the ResultSet that can be set in the Statement object.

Version:
1.00, 06/06/02
Author:
Dave Ross
See Also:
IdmsConnection, IdmsStatement, IdmsResultSet

Field Summary
 
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 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
protected  java.lang.Object get(java.lang.reflect.Field f)
          Allows the default snap method access to non-public variables.
 int getFetchDirection()
          Gets the fetch direction hint.
 int getFetchSize()
          Gets fetch size, always 1 if FOR UPDATE.
 boolean isClosed()
          Tests if the statement or result set is closed.
 void setFetchDirection(int p)
          Sets the fetch direction hint.
 void setFetchSize(int size)
          Sets the fetch size hint.
 
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
finalize, 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
 

Method Detail

get

protected java.lang.Object get(java.lang.reflect.Field f)
                        throws java.lang.IllegalAccessException
Allows the default snap method access to non-public variables.

Overrides:
get in class IdmsJdbcObject
Parameters:
f - a Field returned by Class.getDeclaredFields
Returns:
the Object named by f
Throws:
java.lang.IllegalAccessException - should not happen
See Also:
TraceObject.snap, TraceObject.snap()

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Tests if the statement or result set is closed.

Returns:
true if the connection reference is null
Throws:
java.sql.SQLException - not really

setFetchDirection

public void setFetchDirection(int p)
                       throws java.sql.SQLException
Sets the fetch direction hint. The driver validates the hint but ignores it because IDMS does not provide native support for scrollable cursors. The driver implements TYPE_SCROLL_INSENSITIVE result sets internally by caching rows as they are fetched.

For IdmsStatement this satisfies the Statement interface and sets the "default" fetch direction for ResultSets.

For IdmsResultSet this satisfies the ResultSet interface and sets the "current" fetch direction this ResultSet.

Parameters:
p - ignored if valid
Throws:
java.sql.SQLException - if invalid.
Since:
1.2
See Also:
getFetchDirection()

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Gets the fetch direction hint. IDMS supports cursors are always processed in the forward direction only.

Returns:
FETCH_FORWARD
Throws:
java.sql.SQLException - never
Since:
1.2
See Also:
getFetchDirection()

setFetchSize

public void setFetchSize(int size)
                  throws java.sql.SQLException
Sets the fetch size hint. For IdmsStatement this satisfies the Statement interface and sets the "default" fetch size for ResultSets. The value is also used to derive the number of rows to insert in a single operation for batch updates.

For IdmsResultSet this satisfies the ResultSet interface and sets the "current" fetch size this ResultSet.

If > 0 the actual number of rows fetched may be less than specified to fit within the fetch buffer, which may also be smaller than specified to fit within CCI buffer limits on some platforms.

If 0 the JDBC driver will attempt to fetch an "optimal" number of rows to fit in the internal bulk fetch buffer. This number depends on length of each row, the default buffer size, and the communications path.

When the FOR UPDATE clause os present in the SQL syntax or a CURSOR name has been set the driver will always FETCH 1 row in order to support posistioned UPDATE and DELETE (14.0 or later).

The initial default number of rows can be set using the Options->FetchRows setting in the registry or configuration file.

The default fetch buffer size in bytes can be set using the Options->FetchSize setting in the configuration file. These values are picked up when the connection is first created. We picked those terms a while ago, before JDBC 2.0, hence the slight inconsistency between our names and JDBC's.

Parameters:
size - the requested number of rows
Throws:
java.sql.SQLException - if size < 0 or 0 < getMaxRows() < size
Since:
1.2
See Also:
setFetchSize(int)

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Gets fetch size, always 1 if FOR UPDATE.

Returns:
the current value
Throws:
java.sql.SQLException - never
Since:
1.2
See Also:
setFetchSize(int)


Copyright © 2009 CA, All rights reserved