Class MonetResultSetMetaData

java.lang.Object
org.monetdb.monetdbe.MonetWrapper
org.monetdb.monetdbe.MonetResultSetMetaData
All Implemented Interfaces:
ResultSetMetaData, Wrapper

public class MonetResultSetMetaData
extends MonetWrapper
implements ResultSetMetaData
A ResultSetMetaData suitable for the MonetDB embedded database. An object that can be used to get information about the types and properties of the columns in a ResultSet object.
  • Field Summary

    Fields inherited from interface java.sql.ResultSetMetaData

    columnNoNulls, columnNullable, columnNullableUnknown
  • Method Summary

    Modifier and Type Method Description
    String getCatalogName​(int column)
    Gets the designated column's table's catalog name.
    String getColumnClassName​(int column)
    Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column.
    int getColumnCount()
    Returns the number of columns in this ResultSet object.
    int getColumnDisplaySize​(int column)
    Indicates the designated column's normal maximum width in characters.
    String getColumnLabel​(int column)
    Gets the designated column's suggested title for use in printouts and displays.
    String getColumnName​(int column)
    Get the designated column's name.
    int getColumnType​(int column)
    Retrieves the designated column's SQL type.
    int getColumnTypeInt​(int column)
    Retrieves the designated column's MonetDBe type name as an integer.
    String getColumnTypeName​(int column)
    Retrieves the designated column's MonetDBe type name as a String.
    protected String[] getNames()
    Returns the column names of the ResultSet.
    int getPrecision​(int column)
    Get the designated column's specified column size.
    int getScale​(int column)
    Gets the designated column's number of digits to right of the decimal point.
    String getSchemaName​(int column)
    Get the designated column's table's schema.
    String getTableName​(int column)
    Gets the designated column's table name.
    boolean isAutoIncrement​(int column)
    Indicates whether the designated column is automatically numbered.
    boolean isCaseSensitive​(int column)
    Indicates whether a column's case matters.
    boolean isCurrency​(int column)
    Indicates whether the designated column is a cash value.
    boolean isDefinitelyWritable​(int column)
    Indicates whether a write on the designated column will definitely succeed.
    int isNullable​(int column)
    Indicates the nullability of values in the designated column.
    boolean isReadOnly​(int column)
    Indicates whether the designated column is definitely not writable.
    boolean isSearchable​(int column)
    Indicates whether the designated column can be used in a where clause.
    boolean isSigned​(int column)
    Indicates whether values in the designated column are signed numbers.
    boolean isWritable​(int column)
    Indicates whether it is possible for a write on the designated column to succeed.

    Methods inherited from class org.monetdb.monetdbe.MonetWrapper

    isWrapperFor, unwrap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.sql.Wrapper

    isWrapperFor, unwrap
  • Method Details

    • getNames

      protected String[] getNames()
      Returns the column names of the ResultSet. Used for findColumn(String).
      Returns:
      Array of Strings with column names.
    • getColumnCount

      public int getColumnCount() throws SQLException
      Returns the number of columns in this ResultSet object.
      Specified by:
      getColumnCount in interface ResultSetMetaData
      Returns:
      The number of columns.
      Throws:
      SQLException
    • isAutoIncrement

      public boolean isAutoIncrement​(int column) throws SQLException
      Indicates whether the designated column is automatically numbered. Currently not supported.
      Specified by:
      isAutoIncrement in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true if so; false otherwise
      Throws:
      SQLException
    • isCaseSensitive

      public boolean isCaseSensitive​(int column) throws SQLException
      Indicates whether a column's case matters.
      Specified by:
      isCaseSensitive in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true for all character string columns, else false
      Throws:
      SQLException
    • isSearchable

      public boolean isSearchable​(int column) throws SQLException
      Indicates whether the designated column can be used in a where clause. Because all columns can be used in a where clause, we return always true.
      Specified by:
      isSearchable in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true
      Throws:
      SQLException
    • isCurrency

      public boolean isCurrency​(int column) throws SQLException
      Indicates whether the designated column is a cash value. From the MonetDB database perspective it is by definition unknown whether the value is a currency, so we return false here.
      Specified by:
      isCurrency in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      false
      Throws:
      SQLException
    • isNullable

      public int isNullable​(int column) throws SQLException
      Indicates the nullability of values in the designated column. Currently not supported.
      Specified by:
      isNullable in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true if so; false otherwise
      Throws:
      SQLException
    • isSigned

      public boolean isSigned​(int column) throws SQLException
      Indicates whether values in the designated column are signed numbers. Within MonetDB all numeric types are signed.
      Specified by:
      isSigned in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true if so; false otherwise
      Throws:
      SQLException
    • getColumnDisplaySize

      public int getColumnDisplaySize​(int column) throws SQLException
      Indicates the designated column's normal maximum width in characters. Currently not supported.
      Specified by:
      getColumnDisplaySize in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      the normal maximum number of characters allowed as the width of the designated column
      Throws:
      SQLException
    • getColumnLabel

      public String getColumnLabel​(int column) throws SQLException
      Gets the designated column's suggested title for use in printouts and displays.
      Specified by:
      getColumnLabel in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      the suggested column title
      Throws:
      SQLException - if the column parameter is out of bounds
    • getColumnName

      public String getColumnName​(int column) throws SQLException
      Get the designated column's name.
      Specified by:
      getColumnName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      column name
      Throws:
      SQLException - if the column parameter is out of bounds
    • getSchemaName

      public String getSchemaName​(int column) throws SQLException
      Get the designated column's table's schema.
      Specified by:
      getSchemaName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      schema name or "" if not applicable
      Throws:
      SQLException
    • getTableName

      public String getTableName​(int column) throws SQLException
      Gets the designated column's table name.
      Specified by:
      getTableName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      table name or "" if not applicable
      Throws:
      SQLException
    • getPrecision

      public int getPrecision​(int column) throws SQLException
      Get the designated column's specified column size. The returned value represents the maximum column size for the designated column.
      Specified by:
      getPrecision in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      precision
      Throws:
      SQLException
    • getScale

      public int getScale​(int column) throws SQLException
      Gets the designated column's number of digits to right of the decimal point. 0 is returned for data types where the scale is not applicable.
      Specified by:
      getScale in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      scale
      Throws:
      SQLException
    • getCatalogName

      public String getCatalogName​(int column) throws SQLException
      Gets the designated column's table's catalog name. MonetDB does not support the catalog naming concept, so we return "".
      Specified by:
      getCatalogName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      ""
      Throws:
      SQLException
    • getColumnType

      public int getColumnType​(int column) throws SQLException
      Retrieves the designated column's SQL type.
      Specified by:
      getColumnType in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      SQL type from java.sql.Types
      Throws:
      SQLException - if the column parameter is out of bounds
    • getColumnTypeName

      public String getColumnTypeName​(int column) throws SQLException
      Retrieves the designated column's MonetDBe type name as a String.
      Specified by:
      getColumnTypeName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      MonetDBe type
      Throws:
      SQLException - if the column parameter is out of bounds
    • getColumnTypeInt

      public int getColumnTypeInt​(int column) throws SQLException
      Retrieves the designated column's MonetDBe type name as an integer.
      Parameters:
      column - Column number (starts at 1)
      Returns:
      MonetDBe type as an integer
      Throws:
      SQLException - if the column parameter is out of bounds
    • getColumnClassName

      public String getColumnClassName​(int column) throws SQLException
      Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column.
      Specified by:
      getColumnClassName in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      the fully-qualified name of the class in the Java programming language that would be used by the method ResultSet.getObject to retrieve the value in the specified column
      Throws:
      SQLException - if the column parameter is out of bounds
    • isReadOnly

      public boolean isReadOnly​(int column) throws SQLException
      Indicates whether the designated column is definitely not writable. MonetDB does not support cursor updates, so nothing is writable and we always return true.
      Specified by:
      isReadOnly in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      true
      Throws:
      SQLException
    • isWritable

      public boolean isWritable​(int column) throws SQLException
      Indicates whether it is possible for a write on the designated column to succeed. MonetDB does not support cursor updates, so nothing is writable and we always return false.
      Specified by:
      isWritable in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      false;
      Throws:
      SQLException
    • isDefinitelyWritable

      public boolean isDefinitelyWritable​(int column) throws SQLException
      Indicates whether a write on the designated column will definitely succeed. MonetDB does not support cursor updates, so nothing is writable and we always return false.
      Specified by:
      isDefinitelyWritable in interface ResultSetMetaData
      Parameters:
      column - Column number (starts at 1)
      Returns:
      false;
      Throws:
      SQLException