org.h2.jdbc
Class JdbcResultSetMetaData

java.lang.Object
  extended by org.h2.message.TraceObject
      extended by org.h2.jdbc.JdbcResultSetMetaData
All Implemented Interfaces:
java.sql.ResultSetMetaData, java.sql.Wrapper

public class JdbcResultSetMetaData
extends TraceObject
implements java.sql.ResultSetMetaData

Represents the meta data for a ResultSet.


Field Summary
 
Fields inherited from class org.h2.message.TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQL_EXCEPTION, STATEMENT, XA_DATA_SOURCE, XID
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Method Summary
 java.lang.String getCatalogName(int column)
          Returns the catalog name.
 java.lang.String getColumnClassName(int column)
          Gets the Java class name of the object that will be returned if ResultSet.getObject is called.
 int getColumnCount()
          Returns the number of columns.
 int getColumnDisplaySize(int column)
          Gets the maximum display size for this column.
 java.lang.String getColumnLabel(int column)
          Returns the column label.
 java.lang.String getColumnName(int column)
          Returns the column name.
 int getColumnType(int column)
          Returns the data type of a column.
 java.lang.String getColumnTypeName(int column)
          Returns the data type name of a column.
 int getPrecision(int column)
          Gets the precision for this column.
 int getScale(int column)
          Gets the scale for this column.
 java.lang.String getSchemaName(int column)
          Returns the schema name.
 java.lang.String getTableName(int column)
          Returns the table name.
 boolean isAutoIncrement(int column)
          Checks if this an autoincrement column.
 boolean isCaseSensitive(int column)
          Checks if this column is case sensitive.
 boolean isCurrency(int column)
          Checks if this is a currency column.
 boolean isDefinitelyWritable(int column)
          Checks whether a write on this column will definitely succeed.
 int isNullable(int column)
          Checks if this is nullable column.
 boolean isReadOnly(int column)
          Checks if this column is read only.
 boolean isSearchable(int column)
          Checks if this column is searchable.
 boolean isSigned(int column)
          Checks if this column is signed.
 boolean isWrapperFor(java.lang.Class<?> iface)
          [Not supported] Checks if unwrap can return an object of this class.
 boolean isWritable(int column)
          Checks whether it is possible for a write on this column to succeed.
 java.lang.String toString()
          INTERNAL
<T> T
unwrap(java.lang.Class<T> iface)
          [Not supported] Return an object of this class if possible.
 
Methods inherited from class org.h2.message.TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTrace, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, setTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getColumnCount

public int getColumnCount()
                   throws java.sql.SQLException
Returns the number of columns.

Specified by:
getColumnCount in interface java.sql.ResultSetMetaData
Returns:
the number of columns
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnLabel

public java.lang.String getColumnLabel(int column)
                                throws java.sql.SQLException
Returns the column label.

Specified by:
getColumnLabel in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the column label
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnName

public java.lang.String getColumnName(int column)
                               throws java.sql.SQLException
Returns the column name.

Specified by:
getColumnName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the column name
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnType

public int getColumnType(int column)
                  throws java.sql.SQLException
Returns the data type of a column.

Specified by:
getColumnType in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the data type
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnTypeName

public java.lang.String getColumnTypeName(int column)
                                   throws java.sql.SQLException
Returns the data type name of a column.

Specified by:
getColumnTypeName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the data type
Throws:
java.sql.SQLException - if the result set is closed or invalid

getSchemaName

public java.lang.String getSchemaName(int column)
                               throws java.sql.SQLException
Returns the schema name.

Specified by:
getSchemaName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the schema name
Throws:
java.sql.SQLException - if the result set is closed or invalid

getTableName

public java.lang.String getTableName(int column)
                              throws java.sql.SQLException
Returns the table name.

Specified by:
getTableName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the table name
Throws:
java.sql.SQLException - if the result set is closed or invalid

getCatalogName

public java.lang.String getCatalogName(int column)
                                throws java.sql.SQLException
Returns the catalog name.

Specified by:
getCatalogName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the catalog name
Throws:
java.sql.SQLException - if the result set is closed or invalid

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws java.sql.SQLException
Checks if this an autoincrement column. It always returns false.

Specified by:
isAutoIncrement in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
false
Throws:
java.sql.SQLException - if the result set is closed or invalid

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws java.sql.SQLException
Checks if this column is case sensitive. It always returns true.

Specified by:
isCaseSensitive in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
true
Throws:
java.sql.SQLException - if the result set is closed or invalid

isSearchable

public boolean isSearchable(int column)
                     throws java.sql.SQLException
Checks if this column is searchable. It always returns true.

Specified by:
isSearchable in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
true
Throws:
java.sql.SQLException - if the result set is closed or invalid

isCurrency

public boolean isCurrency(int column)
                   throws java.sql.SQLException
Checks if this is a currency column. It always returns false.

Specified by:
isCurrency in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
false
Throws:
java.sql.SQLException - if the result set is closed or invalid

isNullable

public int isNullable(int column)
               throws java.sql.SQLException
Checks if this is nullable column. Returns ResultSetMetaData.columnNullableUnknown if this is not a column of a table. Otherwise, it returns ResultSetMetaData.columnNoNulls if the column is not nullable, and ResultSetMetaData.columnNullable if it is nullable.

Specified by:
isNullable in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
ResultSetMetaData.column*
Throws:
java.sql.SQLException - if the result set is closed or invalid

isSigned

public boolean isSigned(int column)
                 throws java.sql.SQLException
Checks if this column is signed. It always returns true.

Specified by:
isSigned in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
true
Throws:
java.sql.SQLException - if the result set is closed or invalid

isReadOnly

public boolean isReadOnly(int column)
                   throws java.sql.SQLException
Checks if this column is read only. It always returns false.

Specified by:
isReadOnly in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
false
Throws:
java.sql.SQLException - if the result set is closed or invalid

isWritable

public boolean isWritable(int column)
                   throws java.sql.SQLException
Checks whether it is possible for a write on this column to succeed. It always returns true.

Specified by:
isWritable in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
true
Throws:
java.sql.SQLException - if the result set is closed or invalid

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws java.sql.SQLException
Checks whether a write on this column will definitely succeed. It always returns false.

Specified by:
isDefinitelyWritable in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
false
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnClassName

public java.lang.String getColumnClassName(int column)
                                    throws java.sql.SQLException
Gets the Java class name of the object that will be returned if ResultSet.getObject is called.

Specified by:
getColumnClassName in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the Java class name
Throws:
java.sql.SQLException - if the result set is closed or invalid

getPrecision

public int getPrecision(int column)
                 throws java.sql.SQLException
Gets the precision for this column. This method always returns 0.

Specified by:
getPrecision in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the precision
Throws:
java.sql.SQLException - if the result set is closed or invalid

getScale

public int getScale(int column)
             throws java.sql.SQLException
Gets the scale for this column. This method always returns 0.

Specified by:
getScale in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the scale
Throws:
java.sql.SQLException - if the result set is closed or invalid

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws java.sql.SQLException
Gets the maximum display size for this column.

Specified by:
getColumnDisplaySize in interface java.sql.ResultSetMetaData
Parameters:
column - the column index (1,2,...)
Returns:
the display size
Throws:
java.sql.SQLException - if the result set is closed or invalid

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
[Not supported] Return an object of this class if possible.

Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
[Not supported] Checks if unwrap can return an object of this class.

Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
INTERNAL

Overrides:
toString in class java.lang.Object