ca.idms.jdbc
Class IdmsResultSetMetaData

java.lang.Object
  extended by ca.idms.io.TraceObject
      extended by ca.idms.jdbc.IdmsJdbcObject
          extended by ca.idms.jdbc.IdmsMetaData
              extended by ca.idms.jdbc.IdmsResultSetMetaData
All Implemented Interfaces:
Trace, SQLState, java.sql.ResultSetMetaData, java.sql.Wrapper

public class IdmsResultSetMetaData
extends IdmsMetaData
implements java.sql.ResultSetMetaData

A ResultSetMetaData object can be used to find out about the types and properties of the columns in a ResultSet.


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 java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
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
 java.lang.String getCatalogName(int c)
          Not available in SQLDA.
 java.lang.String getColumnClassName(int c)
          Gets the Java class name corresponding to the column's type as it would be returned by ResultSet.getObject.
 int getColumnCount()
          Gets the number of columns in the ResultSet.
 int getColumnDisplaySize(int c)
          What's the column's normal max width in chars?
 java.lang.String getColumnLabel(int c)
          What's the suggested column title for use in printouts and displays?
 java.lang.String getColumnName(int c)
          What's a column's name?
 int getColumnType(int c)
          What's a column's SQL type?
 java.lang.String getColumnTypeName(int c)
          What's a column's data source specific type name?
 java.lang.String getSchemaName(int c)
          Returns the sceham name for a column from the SQLDAX, if available.
 java.lang.String getTableName(int c)
          Returns the table name for a column from the SQLDAX, if available.
 boolean isAutoIncrement(int c)
          Is the column automatically numbered, thus read-only?
 boolean isCaseSensitive(int c)
          Does a column's case matter?
 boolean isCurrency(int c)
          Is the column a cash value?
 boolean isDefinitelyWritable(int c)
          Will a write on the column definitely succeed?
 int isNullable(int c)
          Can you put a NULL in this column?
 boolean isReadOnly(int c)
          Is a column definitely not writable?
 boolean isSearchable(int c)
          Can the column be used in a where clause?
 boolean isSigned(int c)
          Is the column a signed number?
 boolean isWritable(int c)
          Is it possible for a write on the column to succeed?
 
Methods inherited from class ca.idms.jdbc.IdmsMetaData
getPrecision, getScale
 
Methods inherited from class ca.idms.jdbc.IdmsJdbcObject
clearWarnings, get, 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
 
Methods inherited from interface java.sql.ResultSetMetaData
getPrecision, getScale
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Method Detail

getColumnCount

public int getColumnCount()
                   throws java.sql.SQLException
Gets the number of columns in the ResultSet.

Specified by:
getColumnCount in interface java.sql.ResultSetMetaData
Returns:
the value of SQLDA.SQLD
Throws:
java.sql.SQLException - no really.

isAutoIncrement

public boolean isAutoIncrement(int c)
                        throws java.sql.SQLException
Is the column automatically numbered, thus read-only?

Specified by:
isAutoIncrement in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
false
Throws:
java.sql.SQLException - never

isCaseSensitive

public boolean isCaseSensitive(int c)
                        throws java.sql.SQLException
Does a column's case matter?

Specified by:
isCaseSensitive in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true if a character type, false otherwise.
Throws:
java.sql.SQLException - if column index out of range.

isSearchable

public boolean isSearchable(int c)
                     throws java.sql.SQLException
Can the column be used in a where clause?

Specified by:
isSearchable in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true
Throws:
java.sql.SQLException - never.

isCurrency

public boolean isCurrency(int c)
                   throws java.sql.SQLException
Is the column a cash value?

Specified by:
isCurrency in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
false
Throws:
java.sql.SQLException - never.

isNullable

public int isNullable(int c)
               throws java.sql.SQLException
Can you put a NULL in this column?

Specified by:
isNullable in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
columnNoNulls, columnNullable or columnNullableUnknown
Throws:
java.sql.SQLException - if column number is out of range.

isSigned

public boolean isSigned(int c)
                 throws java.sql.SQLException
Is the column a signed number?

Specified by:
isSigned in interface java.sql.ResultSetMetaData
Overrides:
isSigned in class IdmsMetaData
Parameters:
c - column number
Returns:
true if so
Throws:
java.sql.SQLException - if column number is out of range.

getColumnDisplaySize

public int getColumnDisplaySize(int c)
                         throws java.sql.SQLException
What's the column's normal max width in chars?

Specified by:
getColumnDisplaySize in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
max width
Throws:
java.sql.SQLException - if column number is out of range.

getColumnLabel

public java.lang.String getColumnLabel(int c)
                                throws java.sql.SQLException
What's the suggested column title for use in printouts and displays?

Specified by:
getColumnLabel in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true if so
Throws:
java.sql.SQLException - if column number is out of range.

getColumnName

public java.lang.String getColumnName(int c)
                               throws java.sql.SQLException
What's a column's name?

Specified by:
getColumnName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
SQLVAR.SQLNAME
Throws:
java.sql.SQLException - if column number is out of range.

getTableName

public java.lang.String getTableName(int c)
                              throws java.sql.SQLException
Returns the table name for a column from the SQLDAX, if available.

Specified by:
getTableName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
name of the table or a 0 length string if not available.
Throws:
java.sql.SQLException - if an invalid column number.

getSchemaName

public java.lang.String getSchemaName(int c)
                               throws java.sql.SQLException
Returns the sceham name for a column from the SQLDAX, if available.

Specified by:
getSchemaName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
name of the schema or a 0 length string if not available.
Throws:
java.sql.SQLException - if an invalid column number.

getCatalogName

public java.lang.String getCatalogName(int c)
                                throws java.sql.SQLException
Not available in SQLDA.

Specified by:
getCatalogName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
0 length string
Throws:
java.sql.SQLException - not really.

getColumnType

public int getColumnType(int c)
                  throws java.sql.SQLException
What's a column's SQL type?

Specified by:
getColumnType in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
SQL type
Throws:
java.sql.SQLException - if column number is out of range.

getColumnTypeName

public java.lang.String getColumnTypeName(int c)
                                   throws java.sql.SQLException
What's a column's data source specific type name?

Specified by:
getColumnTypeName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
type name
Throws:
java.sql.SQLException - if column number is out of range.

isReadOnly

public boolean isReadOnly(int c)
                   throws java.sql.SQLException
Is a column definitely not writable?

Specified by:
isReadOnly in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true if session is READ ONLY
Throws:
java.sql.SQLException - unlikely.

isWritable

public boolean isWritable(int c)
                   throws java.sql.SQLException
Is it possible for a write on the column to succeed?

Specified by:
isWritable in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true unless session is READ ONLY
Throws:
java.sql.SQLException - unlikely.

isDefinitelyWritable

public boolean isDefinitelyWritable(int c)
                             throws java.sql.SQLException
Will a write on the column definitely succeed?

Specified by:
isDefinitelyWritable in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
true unless session is READ ONLY
Throws:
java.sql.SQLException - unlikely.

getColumnClassName

public java.lang.String getColumnClassName(int c)
                                    throws java.sql.SQLException
Gets the Java class name corresponding to the column's type as it would be returned by ResultSet.getObject.

Specified by:
getColumnClassName in interface java.sql.ResultSetMetaData
Parameters:
c - column number
Returns:
class name
Throws:
java.sql.SQLException - if column number is out of range.
Since:
1.2


Copyright © 2009 CA, All rights reserved