com.ibm.jtopenlite.database.jdbc
Class JDBCResultSetMetaData
- java.lang.Object
-
- com.ibm.jtopenlite.database.jdbc.JDBCResultSetMetaData
-
- All Implemented Interfaces:
- DatabaseDescribeCallback, java.sql.ResultSetMetaData, java.sql.Wrapper
public class JDBCResultSetMetaData extends java.lang.Object implements java.sql.ResultSetMetaData, DatabaseDescribeCallback
-
-
Constructor Summary
Constructors Constructor and Description JDBCResultSetMetaData(int serverCCSID, java.util.Calendar calendarUsedForConversions, java.lang.String catalog)
-
Method Summary
Methods Modifier and Type Method and Description void
baseColumnName(int fieldIndex, java.lang.String name)
void
baseSchemaName(int fieldIndex, java.lang.String name)
void
baseTableName(int fieldIndex, java.lang.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, java.lang.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, java.lang.String name)
java.lang.String
getCatalogName(int column)
Not implemented.java.lang.String
getColumnClassName(int column)
Not implemented.int
getColumnCount()
int
getColumnDisplaySize(int column)
Not implemented.java.lang.String
getColumnLabel(int column)
java.lang.String
getColumnName(int column)
int
getColumnType(int column)
java.lang.String
getColumnTypeName(int column)
int
getPrecision(int column)
int
getScale(int column)
java.lang.String
getSchemaName(int column)
java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String column, boolean b)
You know you want this, if you're going to be calling getTime() a lot.void
sqlFromSchema(int fieldIndex, java.lang.String name)
void
sqlFromTable(int fieldIndex, java.lang.String name)
void
udtName(int fieldIndex, java.lang.String name)
-
-
-
Constructor Detail
-
JDBCResultSetMetaData
public JDBCResultSetMetaData(int serverCCSID, java.util.Calendar calendarUsedForConversions, java.lang.String catalog)
-
-
Method Detail
-
resultSetDescription
public void resultSetDescription(int numFields, int dateFormat, int timeFormat, int dateSeparator, int timeSeparator, int recordSize)
- Specified by:
resultSetDescription
in interfaceDatabaseDescribeCallback
-
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 interfaceDatabaseDescribeCallback
-
fieldName
public void fieldName(int fieldIndex, java.lang.String name)
- Specified by:
fieldName
in interfaceDatabaseDescribeCallback
-
udtName
public void udtName(int fieldIndex, java.lang.String name)
- Specified by:
udtName
in interfaceDatabaseDescribeCallback
-
baseColumnName
public void baseColumnName(int fieldIndex, java.lang.String name)
- Specified by:
baseColumnName
in interfaceDatabaseDescribeCallback
-
baseTableName
public void baseTableName(int fieldIndex, java.lang.String name)
- Specified by:
baseTableName
in interfaceDatabaseDescribeCallback
-
columnLabel
public void columnLabel(int fieldIndex, java.lang.String name)
- Specified by:
columnLabel
in interfaceDatabaseDescribeCallback
-
baseSchemaName
public void baseSchemaName(int fieldIndex, java.lang.String name)
- Specified by:
baseSchemaName
in interfaceDatabaseDescribeCallback
-
sqlFromTable
public void sqlFromTable(int fieldIndex, java.lang.String name)
- Specified by:
sqlFromTable
in interfaceDatabaseDescribeCallback
-
sqlFromSchema
public void sqlFromSchema(int fieldIndex, java.lang.String name)
- Specified by:
sqlFromSchema
in interfaceDatabaseDescribeCallback
-
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 interfaceDatabaseDescribeCallback
-
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(java.lang.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(java.lang.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 callsetCacheLastOnly()
and use an ORDER BY clause.
-
setUseStringCache
public void setUseStringCache(java.lang.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 ifsetUseStringCache()
was called with a value of true for this column.
-
setCacheLastOnly
public void setCacheLastOnly(java.lang.String column, boolean b)
You know you want this, if you're going to be calling getString() a lot.
-
getCatalogName
public java.lang.String getCatalogName(int column) throws java.sql.SQLException
Not implemented.- Specified by:
getCatalogName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnClassName
public java.lang.String getColumnClassName(int column) throws java.sql.SQLException
Not implemented.- Specified by:
getColumnClassName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnCount
public int getColumnCount() throws java.sql.SQLException
- Specified by:
getColumnCount
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnDisplaySize
public int getColumnDisplaySize(int column) throws java.sql.SQLException
Not implemented.- Specified by:
getColumnDisplaySize
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnLabel
public java.lang.String getColumnLabel(int column) throws java.sql.SQLException
- Specified by:
getColumnLabel
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnName
public java.lang.String getColumnName(int column) throws java.sql.SQLException
- Specified by:
getColumnName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnType
public int getColumnType(int column) throws java.sql.SQLException
- Specified by:
getColumnType
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getColumnTypeName
public java.lang.String getColumnTypeName(int column) throws java.sql.SQLException
- Specified by:
getColumnTypeName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getPrecision
public int getPrecision(int column) throws java.sql.SQLException
- Specified by:
getPrecision
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getScale
public int getScale(int column) throws java.sql.SQLException
- Specified by:
getScale
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getSchemaName
public java.lang.String getSchemaName(int column) throws java.sql.SQLException
- Specified by:
getSchemaName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
getTableName
public java.lang.String getTableName(int column) throws java.sql.SQLException
- Specified by:
getTableName
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isAutoIncrement
public boolean isAutoIncrement(int column) throws java.sql.SQLException
- Specified by:
isAutoIncrement
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isCaseSensitive
public boolean isCaseSensitive(int column) throws java.sql.SQLException
- Specified by:
isCaseSensitive
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isCurrency
public boolean isCurrency(int column) throws java.sql.SQLException
Indicates if the column is a currency value.- Specified by:
isCurrency
in interfacejava.sql.ResultSetMetaData
- Parameters:
column
- The column index (1-based).- Returns:
- Always false. DB2 for IBM i does not directly support currency values.
- Throws:
java.sql.SQLException
- If the column index is not valid.
-
isDefinitelyWritable
public boolean isDefinitelyWritable(int column) throws java.sql.SQLException
- Specified by:
isDefinitelyWritable
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isNullable
public int isNullable(int column) throws java.sql.SQLException
Not implemented.- Specified by:
isNullable
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isReadOnly
public boolean isReadOnly(int column) throws java.sql.SQLException
- Specified by:
isReadOnly
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isSearchable
public boolean isSearchable(int column) throws java.sql.SQLException
- Specified by:
isSearchable
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isSigned
public boolean isSigned(int column) throws java.sql.SQLException
Not implemented.- Specified by:
isSigned
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
isWritable
public boolean isWritable(int column) throws java.sql.SQLException
- Specified by:
isWritable
in interfacejava.sql.ResultSetMetaData
- Throws:
java.sql.SQLException
-
-