Mimer JDBC/MIDP 2.12

com.mimer.jdbc
Class ResultSetMetaData

java.lang.Object
  |
  +--com.mimer.jdbc.ResultSetMetaData

public final class ResultSetMetaData
extends java.lang.Object

The ResultSetMetaData class represents the result of the compilation of a single Mimer SQL statement. If the statement was executed, the ResultSetMetaData object will contain a row count.

The ResultSetMetaData object returned from a compilation will contain one array of output Columns representing the columns in the result set that is returned when the statement executes. If the statement does not return a result set, the array will be empty (outputs.length == 0).

The ResultSetMetaData object also contains an array of input columns representing parameters for a PreparedStatement or CallableStatement. Not that all this array contains all parameters of a CallableStatement, including OUT and INOUT parameters. If the statement does not have any parameters, the inputs array will be empty (inputs.length == 0).

The ResultSetMetaData object will also contain a hashtable with column names so that individual input or output columns can be accessed by name.

See Also:
Statement, PreparedStatement, CallableStatement

Field Summary
static int columnNoNulls
           
static int columnNullable
           
static int columnNullableUnknown
           
 
Method Summary
 java.lang.String getCatalogName(int column)
          Returns the catalog of a column.
 java.lang.String getColumnClassName(int column)
          Returns the class names of the objects returned by ResultSet.getObject.
 int getColumnCount()
          Returns the number of columns in the result set.
 int getColumnDisplaySize(int column)
          Returns the maximum number of characters needed to display the contents of 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 column type.
 java.lang.String getColumnTypeName(int column)
          Returns the column type name.
 int getPrecision(int column)
          Returns the precision of the column.
 int getScale(int column)
          Returns the scale of the column.
 java.lang.String getSchemaName(int column)
          Returns the schema of the column.
 java.lang.String getTableName(int column)
          Returns the table of the column.
 boolean isAutoIncrement(int column)
          Returns if the column is autoincremental.
 boolean isCaseSensitive(int column)
          Returns if the column is sensitive of character case.
 boolean isCurrency(int column)
          Returns if the column is a money or currency data type.
 boolean isDefinitelyWritable(int column)
          Returns if the column is updatable or not.
 int isNullable(int column)
          Returns if the column is nullable.
 boolean isReadOnly(int column)
          Returns if the column is read only.
 boolean isSearchable(int column)
          Returns if the column can be included in a where clause.
 boolean isSigned(int column)
          Returns if the column is signed.
 boolean isWritable(int column)
          Returns if the column is writeable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNoNulls

public static final int columnNoNulls
See Also:
Constant Field Values

columnNullable

public static final int columnNullable
See Also:
Constant Field Values

columnNullableUnknown

public static final int columnNullableUnknown
See Also:
Constant Field Values
Method Detail

getCatalogName

public java.lang.String getCatalogName(int column)
                                throws SQLException
Returns the catalog of a column.

Mimer SQL does not support the notion of catalogs, so this method will always return an empty string.

Parameters:
column - The column number. First column is 1.
Returns:
The catalog name.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnClassName

public java.lang.String getColumnClassName(int column)
                                    throws SQLException
Returns the class names of the objects returned by ResultSet.getObject.

Parameters:
column - The column number. First column is 1.
Returns:
The class name.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnCount

public int getColumnCount()
                   throws SQLException
Returns the number of columns in the result set.

Returns:
The number of columns.
Throws:
SQLException - if an error occurs.

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws SQLException
Returns the maximum number of characters needed to display the contents of this column.

Parameters:
column - The column number. First column is 1.
Returns:
The column display size.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnLabel

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

Parameters:
column - The column number. First column is 1.
Returns:
The column label.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnName

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

Parameters:
column - The column number. First column is 1.
Returns:
The column name.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnType

public int getColumnType(int column)
                  throws SQLException
Returns the column type.

Parameters:
column - The column number. First column is 1.
Returns:
The column type.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getColumnTypeName

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

Parameters:
column - The column number. First column is 1.
Returns:
The column type name.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getPrecision

public int getPrecision(int column)
                 throws SQLException
Returns the precision of the column.

Parameters:
column - The column number. First column is 1.
Returns:
The column precision.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getScale

public int getScale(int column)
             throws SQLException
Returns the scale of the column.

Parameters:
column - The column number. First column is 1.
Returns:
The column scale.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getSchemaName

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

Parameters:
column - The column number. First column is 1.
Returns:
The column schema.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

getTableName

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

Parameters:
column - The column number. First column is 1.
Returns:
The column table name.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws SQLException
Returns if the column is autoincremental.

Mimer SQL always returns false on this method because it uses sequences to automatically generate column values. Sequences are not a part of the column type, and it is therefore not possible to definately determine that a column is autoincremented or not. It all depends on the SQL used to insert data. For example see the below SQL statements where it is not certain at compile time that the insertion will use sequence.

create sequence OUR_SEQUENCE;
create table OUR_TABLE (C1 integer);
insert into OUR_TABLE values (coalesce(cast(? as integer),next_value of OUR_SEQUENCE));

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was automatically incremented.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws SQLException
Returns if the column is sensitive of character case.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was sensitive of character case.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isCurrency

public boolean isCurrency(int column)
                   throws SQLException
Returns if the column is a money or currency data type.

Mimer SQL has no special data type for money or currencies. This will always return false.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was a money data type.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws SQLException
Returns if the column is updatable or not.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was updatable.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.
See Also:
isReadOnly(int)

isNullable

public int isNullable(int column)
               throws SQLException
Returns if the column is nullable.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was nullable.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isReadOnly

public boolean isReadOnly(int column)
                   throws SQLException
Returns if the column is read only.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was read only.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.
See Also:
isDefinitelyWritable(int)

isSearchable

public boolean isSearchable(int column)
                     throws SQLException
Returns if the column can be included in a where clause.

Mimer SQL has no limitations on which columns may be included in a where clause. This will return true for any column.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column could be included in a where clause.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.

isSigned

public boolean isSigned(int column)
                 throws SQLException
Returns if the column is signed.

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was signed.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.
See Also:
isDefinitelyWritable(int)

isWritable

public boolean isWritable(int column)
                   throws SQLException
Returns if the column is writeable

Parameters:
column - The column number. First column is 1.
Returns:
True if the column was writable.
Throws:
SQLException - if an error occurs. SQLSTATE 07009 is thrown if the column dos not exist.
See Also:
isDefinitelyWritable(int)

Mimer JDBC/MIDP 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC for the CLDC/MID Profile Specification
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.