com.ibm.jtopenlite.database.jdbc
Class JDBCResultSetMetaData

java.lang.Object
  extended by com.ibm.jtopenlite.database.jdbc.JDBCResultSetMetaData
All Implemented Interfaces:
DatabaseDescribeCallback, ResultSetMetaData

public class JDBCResultSetMetaData
extends Object
implements ResultSetMetaData, DatabaseDescribeCallback


Field Summary
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Constructor Summary
JDBCResultSetMetaData(int serverCCSID, Calendar calendarUsedForConversions, String catalog)
           
 
Method Summary
 void baseColumnName(int fieldIndex, String name)
           
 void baseSchemaName(int fieldIndex, String name)
           
 void baseTableName(int fieldIndex, String name)
           
 void columnAttributes(int fieldIndex, int updateable, int searchable, boolean isIdentity, boolean isAlwaysGenerated, boolean isPartOfAnyIndex, boolean isLoneUniqueIndex, boolean isPartOfUniqueIndex, boolean isExpression, boolean isPrimaryKey, boolean isNamed, boolean isRowID, boolean isRowChangeTimestamp)
           
 void columnLabel(int fieldIndex, String name)
           
 void fieldDescription(int fieldIndex, int type, int length, int scale, int precision, int ccsid, int joinRefPosition, int attributeBitmap, int lobMaxSize)
           
 void fieldName(int fieldIndex, String name)
           
 String getCatalogName(int column)
          Not implemented.
 String getColumnClassName(int column)
          Not implemented.
 int getColumnCount()
           
 int getColumnDisplaySize(int column)
          Not implemented.
 String getColumnLabel(int column)
           
 String getColumnName(int column)
           
 int getColumnType(int column)
           
 String getColumnTypeName(int column)
           
 int getPrecision(int column)
           
 int getScale(int column)
           
 String getSchemaName(int column)
           
 String getTableName(int column)
           
 boolean isAutoIncrement(int column)
           
 boolean isCaseSensitive(int column)
           
 boolean isCurrency(int column)
          Indicates if the column is a currency value.
 boolean isDefinitelyWritable(int column)
           
 int isNullable(int column)
          Not implemented.
 boolean isReadOnly(int column)
           
 boolean isSearchable(int column)
           
 boolean isSigned(int column)
          Not implemented.
 boolean isWritable(int column)
           
 void resultSetDescription(int numFields, int dateFormat, int timeFormat, int dateSeparator, int timeSeparator, int recordSize)
           
 void setCacheLastOnly(int column, boolean b)
          Caches the last String returned by ResultSet.getString(column), and returns that same object on the next call to ResultSet.getString(column) if the value returned from the database is identical.
 void setCacheLastOnly(String column, boolean b)
          You know you want this, if you're going to be calling getString() a lot.
 void setUseDateCache(int column, boolean b)
          Caches the last Date returned by ResultSet.getDate(column), and returns that same object on the next call to ResultSet.getDate(column) if the value returned from the database is identical.
 void setUseDateCache(String column, boolean b)
          You know you want this, if you're going to be calling getDate() a lot.
 void setUseStringCache(int column, boolean b)
          Caches all unique Strings returned by ResultSet.getString(column).
 void setUseStringCache(String column, boolean b)
          You know you want this, if you're going to be calling getString() a lot.
 void setUseTimeCache(int column, boolean b)
          Caches the last Time returned by ResultSet.getTime(column), and returns that same object on the next call to ResultSet.getTime(column) if the value returned from the database is identical.
 void setUseTimeCache(String column, boolean b)
          You know you want this, if you're going to be calling getTime() a lot.
 void sqlFromSchema(int fieldIndex, String name)
           
 void sqlFromTable(int fieldIndex, String name)
           
 void udtName(int fieldIndex, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCResultSetMetaData

public JDBCResultSetMetaData(int serverCCSID,
                             Calendar calendarUsedForConversions,
                             String catalog)
Method Detail

resultSetDescription

public void resultSetDescription(int numFields,
                                 int dateFormat,
                                 int timeFormat,
                                 int dateSeparator,
                                 int timeSeparator,
                                 int recordSize)
Specified by:
resultSetDescription in interface DatabaseDescribeCallback

fieldDescription

public void fieldDescription(int fieldIndex,
                             int type,
                             int length,
                             int scale,
                             int precision,
                             int ccsid,
                             int joinRefPosition,
                             int attributeBitmap,
                             int lobMaxSize)
Specified by:
fieldDescription in interface DatabaseDescribeCallback

fieldName

public void fieldName(int fieldIndex,
                      String name)
Specified by:
fieldName in interface DatabaseDescribeCallback

udtName

public void udtName(int fieldIndex,
                    String name)
Specified by:
udtName in interface DatabaseDescribeCallback

baseColumnName

public void baseColumnName(int fieldIndex,
                           String name)
Specified by:
baseColumnName in interface DatabaseDescribeCallback

baseTableName

public void baseTableName(int fieldIndex,
                          String name)
Specified by:
baseTableName in interface DatabaseDescribeCallback

columnLabel

public void columnLabel(int fieldIndex,
                        String name)
Specified by:
columnLabel in interface DatabaseDescribeCallback

baseSchemaName

public void baseSchemaName(int fieldIndex,
                           String name)
Specified by:
baseSchemaName in interface DatabaseDescribeCallback

sqlFromTable

public void sqlFromTable(int fieldIndex,
                         String name)
Specified by:
sqlFromTable in interface DatabaseDescribeCallback

sqlFromSchema

public void sqlFromSchema(int fieldIndex,
                          String name)
Specified by:
sqlFromSchema in interface DatabaseDescribeCallback

columnAttributes

public void columnAttributes(int fieldIndex,
                             int updateable,
                             int searchable,
                             boolean isIdentity,
                             boolean isAlwaysGenerated,
                             boolean isPartOfAnyIndex,
                             boolean isLoneUniqueIndex,
                             boolean isPartOfUniqueIndex,
                             boolean isExpression,
                             boolean isPrimaryKey,
                             boolean isNamed,
                             boolean isRowID,
                             boolean isRowChangeTimestamp)
Specified by:
columnAttributes in interface DatabaseDescribeCallback

setUseDateCache

public void setUseDateCache(int column,
                            boolean b)
Caches the last Date returned by ResultSet.getDate(column), and returns that same object on the next call to ResultSet.getDate(column) if the value returned from the database is identical. This also works for repeated calls to ResultSet.getDate(column) when the ResultSet has not changed rows.


setUseDateCache

public void setUseDateCache(String column,
                            boolean b)
You know you want this, if you're going to be calling getDate() a lot.


setUseTimeCache

public void setUseTimeCache(int column,
                            boolean b)
Caches the last Time returned by ResultSet.getTime(column), and returns that same object on the next call to ResultSet.getTime(column) if the value returned from the database is identical. This also works for repeated calls to ResultSet.getTime(column) when the ResultSet has not changed rows.


setUseTimeCache

public void setUseTimeCache(String column,
                            boolean b)
You know you want this, if you're going to be calling getTime() a lot.


setUseStringCache

public void setUseStringCache(int column,
                              boolean b)
Caches all unique Strings returned by ResultSet.getString(column). Any subsequent call to ResultSet.getString(column) will attempt to return a previously cached object if the value returned from the database matches something in the cache. This also works for repeated calls to ResultSet.getString(column) when the ResultSet has not changed rows. Note this will cache *ALL* Strings for this column, so unless you know your column values will only ever be a finite set, you should also call setCacheLastOnly() and use an ORDER BY clause.


setUseStringCache

public void setUseStringCache(String column,
                              boolean b)
You know you want this, if you're going to be calling getString() a lot.


setCacheLastOnly

public void setCacheLastOnly(int column,
                             boolean b)
Caches the last String returned by ResultSet.getString(column), and returns that same object on the next call to ResultSet.getString(column) if the value returned from the database is identical. This also works for repeated calls to ResultSet.getString(column) when the ResultSet has not changed rows. This setting only takes effect if setUseStringCache() was called with a value of true for this column.


setCacheLastOnly

public void setCacheLastOnly(String column,
                             boolean b)
You know you want this, if you're going to be calling getString() a lot.


getCatalogName

public String getCatalogName(int column)
                      throws SQLException
Not implemented.

Specified by:
getCatalogName in interface ResultSetMetaData
Throws:
SQLException

getColumnClassName

public String getColumnClassName(int column)
                          throws SQLException
Not implemented.

Specified by:
getColumnClassName in interface ResultSetMetaData
Throws:
SQLException

getColumnCount

public int getColumnCount()
                   throws SQLException
Specified by:
getColumnCount in interface ResultSetMetaData
Throws:
SQLException

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws SQLException
Not implemented.

Specified by:
getColumnDisplaySize in interface ResultSetMetaData
Throws:
SQLException

getColumnLabel

public String getColumnLabel(int column)
                      throws SQLException
Specified by:
getColumnLabel in interface ResultSetMetaData
Throws:
SQLException

getColumnName

public String getColumnName(int column)
                     throws SQLException
Specified by:
getColumnName in interface ResultSetMetaData
Throws:
SQLException

getColumnType

public int getColumnType(int column)
                  throws SQLException
Specified by:
getColumnType in interface ResultSetMetaData
Throws:
SQLException

getColumnTypeName

public String getColumnTypeName(int column)
                         throws SQLException
Specified by:
getColumnTypeName in interface ResultSetMetaData
Throws:
SQLException

getPrecision

public int getPrecision(int column)
                 throws SQLException
Specified by:
getPrecision in interface ResultSetMetaData
Throws:
SQLException

getScale

public int getScale(int column)
             throws SQLException
Specified by:
getScale in interface ResultSetMetaData
Throws:
SQLException

getSchemaName

public String getSchemaName(int column)
                     throws SQLException
Specified by:
getSchemaName in interface ResultSetMetaData
Throws:
SQLException

getTableName

public String getTableName(int column)
                    throws SQLException
Specified by:
getTableName in interface ResultSetMetaData
Throws:
SQLException

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws SQLException
Specified by:
isAutoIncrement in interface ResultSetMetaData
Throws:
SQLException

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws SQLException
Specified by:
isCaseSensitive in interface ResultSetMetaData
Throws:
SQLException

isCurrency

public boolean isCurrency(int column)
                   throws SQLException
Indicates if the column is a currency value.

Specified by:
isCurrency in interface ResultSetMetaData
Parameters:
columnIndex - The column index (1-based).
Returns:
Always false. DB2 for IBM i does not directly support currency values.
Throws:
SQLException - If the column index is not valid.

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws SQLException
Specified by:
isDefinitelyWritable in interface ResultSetMetaData
Throws:
SQLException

isNullable

public int isNullable(int column)
               throws SQLException
Not implemented.

Specified by:
isNullable in interface ResultSetMetaData
Throws:
SQLException

isReadOnly

public boolean isReadOnly(int column)
                   throws SQLException
Specified by:
isReadOnly in interface ResultSetMetaData
Throws:
SQLException

isSearchable

public boolean isSearchable(int column)
                     throws SQLException
Specified by:
isSearchable in interface ResultSetMetaData
Throws:
SQLException

isSigned

public boolean isSigned(int column)
                 throws SQLException
Not implemented.

Specified by:
isSigned in interface ResultSetMetaData
Throws:
SQLException

isWritable

public boolean isWritable(int column)
                   throws SQLException
Specified by:
isWritable in interface ResultSetMetaData
Throws:
SQLException