Mimer JDBC Engine 2.12

com.mimer.jdbc
Class ResultSetMetaData

java.lang.Object
  |
  +--com.mimer.jdbc.ResultSetMetaData
All Implemented Interfaces:
ResultSetMetaData

public final class ResultSetMetaData
extends Object
implements ResultSetMetaData

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
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Method Summary
 String getCatalogName(int column)
          Returns the catalog of a column.
 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.
 String getColumnLabel(int column)
          Returns the column label.
 String getColumnName(int column)
          Returns the column name.
 int getColumnType(int column)
          Returns the column type.
 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.
 String getSchemaName(int column)
          Returns the schema of the column.
 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
 

Method Detail

getCatalogName

public 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.

Specified by:
getCatalogName in interface ResultSetMetaData
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 String getColumnClassName(int column)
                          throws SQLException
Returns the class names of the objects returned by ResultSet.getObject.

Specified by:
getColumnClassName in interface ResultSetMetaData
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.

Specified by:
getColumnCount in interface ResultSetMetaData
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.

Specified by:
getColumnDisplaySize in interface ResultSetMetaData
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 String getColumnLabel(int column)
                      throws SQLException
Returns the column label.

Specified by:
getColumnLabel in interface ResultSetMetaData
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 String getColumnName(int column)
                     throws SQLException
Returns the column name.

Specified by:
getColumnName in interface ResultSetMetaData
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.

Specified by:
getColumnType in interface ResultSetMetaData
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 String getColumnTypeName(int column)
                         throws SQLException
Returns the column type name.

Specified by:
getColumnTypeName in interface ResultSetMetaData
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.

Specified by:
getPrecision in interface ResultSetMetaData
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.

Specified by:
getScale in interface ResultSetMetaData
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 String getSchemaName(int column)
                     throws SQLException
Returns the schema of the column.

Specified by:
getSchemaName in interface ResultSetMetaData
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 String getTableName(int column)
                    throws SQLException
Returns the table of the column.

Specified by:
getTableName in interface ResultSetMetaData
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));

Specified by:
isAutoIncrement in interface ResultSetMetaData
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.

Specified by:
isCaseSensitive in interface ResultSetMetaData
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.

Specified by:
isCurrency in interface ResultSetMetaData
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.

Specified by:
isDefinitelyWritable in interface ResultSetMetaData
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.

Specified by:
isNullable in interface ResultSetMetaData
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.

Specified by:
isReadOnly in interface ResultSetMetaData
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.

Specified by:
isSearchable in interface ResultSetMetaData
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.

Specified by:
isSigned in interface ResultSetMetaData
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

Specified by:
isWritable in interface ResultSetMetaData
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 Engine 2.12

Submit a comment or suggestion Version 2.12 of Mimer JDBC Engine
Copyright Upright Database Technology AB, Box 1713, SE-751 47 UPPSALA, Sweden. All Rights Reserved.