kotkabeans
Class RSMetaData

java.lang.Object
  |
  +--kotkabeans.RSMetaData

public class RSMetaData
extends java.lang.Object

Stores data of ResultSetMetaData. Info of one column is saved in RSColumn object and all columns are in ArrayList which starts from index 1.

See Also:
ResultSetMetaData, RSContainer

Nested Class Summary
protected  class RSMetaData.RSColumn
          Stores info of one column of ResultSetMetaData
 
Field Summary
protected  int columnCount
           
protected  RSMetaData.RSColumn[] columns
           
 
Constructor Summary
RSMetaData()
          Dummy empty constructor.
RSMetaData(java.sql.ResultSetMetaData rsmd)
          Constructor with ResultSetMetaData as parameter
 
Method Summary
 int getColumnCount()
          Returns the number of columns in this RSContainer object.
 int getColumnIndex(java.lang.String columnName)
          Returns the fully-qualified name of the Java class whose instances are manufactured if the method RSContainer.getObject is called to retrieve a value from the column.
 java.lang.String getColumnLabel(int column)
          Gets the wanted column's suggested title for use in printouts and displays.
 java.lang.String getColumnName(int column)
          Get wanted column's name.
 int getColumnType(int column)
          Retrieves the wanted column's SQL type.
 java.lang.String getColumnTypeName(int column)
          Retrieves the wanted column's database-specific type name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnCount

protected int columnCount

columns

protected RSMetaData.RSColumn[] columns
Constructor Detail

RSMetaData

public RSMetaData()
Dummy empty constructor.


RSMetaData

public RSMetaData(java.sql.ResultSetMetaData rsmd)
           throws java.sql.SQLException
Constructor with ResultSetMetaData as parameter

Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in this RSContainer object.

Returns:
the number of columns

getColumnName

public java.lang.String getColumnName(int column)
                               throws java.lang.IndexOutOfBoundsException
Get wanted column's name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
column name
Throws:
java.lang.IndexOutOfBoundsException - if column is out of range (column<0 || column>=getColumCount())

getColumnLabel

public java.lang.String getColumnLabel(int column)
                                throws java.lang.IndexOutOfBoundsException
Gets the wanted column's suggested title for use in printouts and displays.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
the suggested column title
Throws:
java.lang.IndexOutOfBoundsException - if column is out of range (column<0 || column>=getColumCount())

getColumnType

public int getColumnType(int column)
                  throws java.lang.IndexOutOfBoundsException
Retrieves the wanted column's SQL type.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
SQL type from java.sql.Types
Throws:
java.lang.IndexOutOfBoundsException - if column is out of range (column<0 || column>=getColumCount())

getColumnTypeName

public java.lang.String getColumnTypeName(int column)
                                   throws java.lang.IndexOutOfBoundsException
Retrieves the wanted column's database-specific type name.

Parameters:
column - the first column is 1, the second is 2, ...
Returns:
type name used by the database. If the column type is a user-defined type, then a fully-qualified type name is returned.
Throws:
java.lang.IndexOutOfBoundsException - if column is out of range (column<0 || column>=getColumCount())

getColumnIndex

public int getColumnIndex(java.lang.String columnName)
                   throws java.lang.Exception
Returns the fully-qualified name of the Java class whose instances are manufactured if the method RSContainer.getObject is called to retrieve a value from the column. RSContainer.getObject may return a subclass of the class returned by this method

Returns:
the fully-qualified name of the class in the Java programming language that would be used by the method RSContainer.getObject to retrieve the value in the specified column. This is the class name used for custom mapping.
Throws:
java.lang.IndexOutOfBoundsException - if column is out of range (column<0 || column>=getColumCount()) public String getColumnClassName(int column) throws IndexOutOfBoundsException { if ( column < 0 || column >= getColumnCount() ) throw new IndexOutOfBoundsException("Column index out of bounds."); RSColumn col = (RSColumn)this.columns.get(column); return col.getClassName(); } /**
java.lang.Exception