litebase
Class ResultSetMetaData

java.lang.Object
  |
  +--litebase.ResultSetMetaData

public final class ResultSetMetaData
extends java.lang.Object

This class returns useful information for the resultset columns. Note that the information can be retrieved even if the ResultSet returns no data.

Important: you cannot retrieve these informations if the ResultSet is closed!


Field Summary
static int CHAR_NOCASE_TYPE
          Used by the getColumnType method
static int CHAR_TYPE
          Used by the getColumnType method
static int DATE_TYPE
          Used by the getColumnType method
static int DATETIME_TYPE
          Used by the getColumnType method
static int DOUBLE_TYPE
          Used by the getColumnType method
static int FLOAT_TYPE
          Used by the getColumnType method
static int INT_TYPE
          Used by the getColumnType method
static int LONG_TYPE
          Used by the getColumnType method
protected  ResultSet rs
          The underlying resultset
static int SHORT_TYPE
          Used by the getColumnType method
 
Constructor Summary
protected ResultSetMetaData(ResultSet rs)
           
 
Method Summary
 int getColumnCount()
          Returns the number of columns for this resultset
 int getColumnDisplaySize(int column)
          Given the column index (starting at 1), returns the display size.
 java.lang.String getColumnLabel(int column)
          Given the column index (starting at 1), returns the column name.
 int getColumnType(int column)
          Given the column index (starting at 1), returns the column type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rs

protected ResultSet rs
The underlying resultset

CHAR_TYPE

public static final int CHAR_TYPE
Used by the getColumnType method

SHORT_TYPE

public static final int SHORT_TYPE
Used by the getColumnType method

INT_TYPE

public static final int INT_TYPE
Used by the getColumnType method

LONG_TYPE

public static final int LONG_TYPE
Used by the getColumnType method

FLOAT_TYPE

public static final int FLOAT_TYPE
Used by the getColumnType method

DOUBLE_TYPE

public static final int DOUBLE_TYPE
Used by the getColumnType method

CHAR_NOCASE_TYPE

public static final int CHAR_NOCASE_TYPE
Used by the getColumnType method

DATE_TYPE

public static final int DATE_TYPE
Used by the getColumnType method

DATETIME_TYPE

public static final int DATETIME_TYPE
Used by the getColumnType method
Constructor Detail

ResultSetMetaData

protected ResultSetMetaData(ResultSet rs)
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns for this resultset

getColumnDisplaySize

public int getColumnDisplaySize(int column)
Given the column index (starting at 1), returns the display size. For chars, it will return the number of chars defined; for primitive types, it will return the number of decimal places it needs to be displayed correctly. Returns 0 if an error occurs.

getColumnLabel

public java.lang.String getColumnLabel(int column)
Given the column index (starting at 1), returns the column name. Note that if you used an alias to the column, the alias will be returned instead. If an error occurs, an empty string is returned. Note that LitebaseConnection 1.x tables must be recreated to be able to return this label information.

getColumnType

public int getColumnType(int column)
Given the column index (starting at 1), returns the column type.
See Also:
SHORT_TYPE, INT_TYPE, LONG_TYPE, FLOAT_TYPE, DOUBLE_TYPE, CHAR_TYPE, CHAR_NOCASE_TYPE, DATE_TYPE, DATETIME_TYPE