Package virtuoso.jdbc4

## Class VirtuosoResultSetMetaData

- java.lang.Object
- - virtuoso.jdbc4.VirtuosoResultSetMetaData

All Implemented Interfaces:
  `java.sql.ResultSetMetaData`, `java.sql.Wrapper`

    public class VirtuosoResultSetMetaData
    extends java.lang.Object
    implements java.sql.ResultSetMetaData

The VirtuosoResultSetMetaData class is an implementation of the ResultSetMetaData interface in the JDBC API that represents information about a ResultSet. You can obtain one like below :

       ResultSetMetaData metadata = resultset.getMetaData()

See Also:
  `ResultSetMetaData`, `VirtuosoResultSet.getMetaData()`

### Field Summary

Fields
`protected java.util.Hashtable<virtuoso.jdbc4.VirtuosoColumn,java.lang.Integer>` `hcolumns`

### Fields inherited from interface java.sql.ResultSetMetaData

`columnNoNulls, columnNullable, columnNullableUnknown`

### Constructor Summary

Constructors
`protected` `VirtuosoResultSetMetaData​(VirtuosoConnection conn, java.lang.String[] columns, int[] dtps)` Constructs a new VirtuosoResultSetMetaData.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected static java.lang.String` `_getColumnTypeName​(int columnType)`
`void` `close​()` Releases this ResultSetMetaData object's database and JDBC resources immediately instead of new wait for this to happen when it is automatically closed.
`java.lang.String` `getCatalogName​(int column)` Gets a column table's catalog name.
`java.lang.String` `getColumnClassName​(int column)` Returns the fully-qualified name of the Java class.
`int` `getColumnCount​()` Returns the number of columns in the ResultSet.
`int` `getColumnDisplaySize​(int column)` Indicates the column normal max width in chars.
`protected int` `getColumnDtp​(int column)`
`java.lang.String` `getColumnLabel​(int column)` Gets the suggested column title for use in printouts and displays.
`java.lang.String` `getColumnName​(int column)` Gets a column name.
`int` `getColumnType​(int column)` Retrieves a column SQL type.
`java.lang.String` `getColumnTypeName​(int column)` Retrieves a column database-specific type name.
`int` `getPrecision​(int column)` Gets a column number of decimal digits.
`int` `getScale​(int column)` Gets a column number of digits to right of the decimal point.
`java.lang.String` `getSchemaName​(int column)` Gets a column table's schema.
`java.lang.String` `getTableName​(int column)` Gets a column table name.
`boolean` `isAutoIncrement​(int column)` Indicates whether the column is automatically numbered, thus read-only.
`boolean` `isCaseSensitive​(int column)` Indicates whether a column case matters.
`boolean` `isCurrency​(int column)` Indicates whether the column is a cash value.
`boolean` `isDefinitelyWritable​(int column)` Indicates whether a write on the column will definitely succeed.
`int` `isNullable​(int column)` Indicates the nullability of values in the designated column.
`boolean` `isReadOnly​(int column)` Indicates whether a column is definitely not writable.
`boolean` `isSearchable​(int column)` Indicates whether the column can be used in a where clause.
`boolean` `isSigned​(int column)` Indicates whether values in the column are signed numbers.
`boolean` `isWrapperFor​(java.lang.Class<?> iface)` Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
`boolean` `isWritable​(int column)` Indicates whether it is possible for a write on the column to succeed.
`protected boolean` `isXml​(int column)`
`void` `setColumnName​(int column, java.lang.String name)`
`<T> T` `unwrap​(java.lang.Class<T> iface)` Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

### Methods inherited from class java.lang.Object

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

### Field Detail

#### hcolumns

    protected java.util.Hashtable<virtuoso.jdbc4.VirtuosoColumn,java.lang.Integer> hcolumns

### Constructor Detail

#### VirtuosoResultSetMetaData

    protected VirtuosoResultSetMetaData​(VirtuosoConnection conn,
                                        java.lang.String[] columns,
                                        int[] dtps)

Constructs a new VirtuosoResultSetMetaData.

Parameters:
  `conn` - The connection
  `columns` - The column description in the DV format.
  `dtps` - The dataType

### Method Detail

#### getColumnCount

    public int getColumnCount​()
                       throws VirtuosoException

Returns the number of columns in the ResultSet.

Specified by:
  `getColumnCount` in interface `java.sql.ResultSetMetaData`
Returns:
  int The number of columns.
Throws:
  `VirtuosoException` - No errors returned (just an implementation question).
See Also:
  `ResultSetMetaData.getColumnCount()`

#### isAutoIncrement

    public boolean isAutoIncrement​(int column)
                            throws VirtuosoException

Indicates whether the column is automatically numbered, thus read-only.

Specified by:
  `isAutoIncrement` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isAutoIncrement(int)`

#### isCaseSensitive

    public boolean isCaseSensitive​(int column)
                            throws VirtuosoException

Indicates whether a column case matters.

Specified by:
  `isCaseSensitive` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isCaseSensitive(int)`

#### isSearchable

    public boolean isSearchable​(int column)
                         throws VirtuosoException

Indicates whether the column can be used in a where clause.

Specified by:
  `isSearchable` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isSearchable(int)`

#### isCurrency

    public boolean isCurrency​(int column)
                       throws VirtuosoException

Indicates whether the column is a cash value.

Specified by:
  `isCurrency` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isCurrency(int)`

#### isNullable

    public int isNullable​(int column)
                   throws VirtuosoException

Indicates the nullability of values in the designated column.

Specified by:
  `isNullable` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  the nullability status of the given column; one of columnNoNulls, columnNullable or columnNullableUnknown
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isNullable(int)`

#### isSigned

    public boolean isSigned​(int column)
                     throws VirtuosoException

Indicates whether values in the column are signed numbers.

Specified by:
  `isSigned` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isSigned(int)`

#### getColumnDisplaySize

    public int getColumnDisplaySize​(int column)
                             throws VirtuosoException

Indicates the column normal max width in chars.

Specified by:
  `getColumnDisplaySize` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  the normal maximum number of characters allowed as the width of the designated column
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnDisplaySize(int)`

#### getColumnLabel

    public java.lang.String getColumnLabel​(int column)
                                    throws VirtuosoException

Gets the suggested column title for use in printouts and displays.

Specified by:
  `getColumnLabel` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  String The suggested column title.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnLabel(int)`

#### getColumnName

    public java.lang.String getColumnName​(int column)
                                   throws VirtuosoException

Gets a column name.

Specified by:
  `getColumnName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  String The column name.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnName(int)`

#### setColumnName

    public void setColumnName​(int column,
                              java.lang.String name)
                       throws VirtuosoException

Throws:
  `VirtuosoException`

#### getPrecision

    public int getPrecision​(int column)
                     throws VirtuosoException

Gets a column number of decimal digits.

Specified by:
  `getPrecision` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  int The column precision.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getPrecision(int)`

#### getScale

    public int getScale​(int column)
                 throws VirtuosoException

Gets a column number of digits to right of the decimal point.

Specified by:
  `getScale` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  int The column scale.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getScale(int)`

#### getColumnType

    public int getColumnType​(int column)
                      throws VirtuosoException

Retrieves a column SQL type.

Specified by:
  `getColumnType` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  int SQL type.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnType(int)`, `Types`

#### getColumnTypeName

    public java.lang.String getColumnTypeName​(int column)
                                       throws VirtuosoException

Retrieves a column database-specific type name.

Specified by:
  `getColumnTypeName` in interface `java.sql.ResultSetMetaData`
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:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnTypeName(int)`

#### _getColumnTypeName

    protected static java.lang.String _getColumnTypeName​(int columnType)
                                                  throws VirtuosoException

Throws:
  `VirtuosoException`

#### isReadOnly

    public boolean isReadOnly​(int column)
                       throws VirtuosoException

Indicates whether a column is definitely not writable.

Specified by:
  `isReadOnly` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isReadOnly(int)`

#### isWritable

    public boolean isWritable​(int column)
                       throws VirtuosoException

Indicates whether it is possible for a write on the column to succeed.

Specified by:
  `isWritable` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isWritable(int)`

#### isDefinitelyWritable

    public boolean isDefinitelyWritable​(int column)
                                 throws VirtuosoException

Indicates whether a write on the column will definitely succeed.

Specified by:
  `isDefinitelyWritable` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  boolean True if so.
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.isDefinitelyWritable(int)`

#### getColumnClassName

    public java.lang.String getColumnClassName​(int column)
                                        throws VirtuosoException

Returns the fully-qualified name of the Java class.

Specified by:
  `getColumnClassName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  the fully-qualified name of the class in the Java programming language that would be used by the method
Throws:
  `VirtuosoException` - If an internal error occurred.
See Also:
  `ResultSetMetaData.getColumnClassName(int)`

#### getSchemaName

    public java.lang.String getSchemaName​(int column)
                                   throws VirtuosoException

Gets a column table's schema.

Specified by:
  `getSchemaName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  schema name or "" if not applicable
Throws:
  `VirtuosoException` - if a database access error occurs

#### getTableName

    public java.lang.String getTableName​(int column)
                                  throws VirtuosoException

Gets a column table name.

Specified by:
  `getTableName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  table name or "" if not applicable
Throws:
  `VirtuosoException` - if a database access error occurs

#### getCatalogName

    public java.lang.String getCatalogName​(int column)
                                    throws VirtuosoException

Gets a column table's catalog name.

Specified by:
  `getCatalogName` in interface `java.sql.ResultSetMetaData`
Parameters:
  `column` - the first column is 1, the second is 2, ...
Returns:
  column name or "" if not applicable.
Throws:
  `VirtuosoException` - if a database access error occurs

#### close

    public void close​()
               throws VirtuosoException

Releases this ResultSetMetaData object's database and JDBC resources immediately instead of new wait for this to happen when it is automatically closed. Note: A ResultSetMetaData is automatically closed by the ResultSet that generated it when that ResultSet is closed.

Throws:
  `VirtuosoException` - An internal error occurred.

#### getColumnDtp

    protected int getColumnDtp​(int column)

#### isXml

    protected boolean isXml​(int column)

#### unwrap

    public <T> T unwrap​(java.lang.Class<T> iface)
                 throws java.sql.SQLException

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling `unwrap` recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an `SQLException` is thrown.

Specified by:
  `unwrap` in interface `java.sql.Wrapper`
Parameters:
  `iface` - A Class defining an interface that the result must implement.
Returns:
  an object that implements the interface. May be a proxy for the actual implementing object.
Throws:
  `java.sql.SQLException` - If no object found that implements the interface
Since:
  1.6

#### isWrapperFor

    public boolean isWrapperFor​(java.lang.Class<?> iface)
                         throws java.sql.SQLException

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling `isWrapperFor` on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to `unwrap` so that callers can use this method to avoid expensive `unwrap` calls that may fail. If this method returns true then calling `unwrap` with the same argument should succeed.

Specified by:
  `isWrapperFor` in interface `java.sql.Wrapper`
Parameters:
  `iface` - a Class defining an interface.
Returns:
  true if this implements the interface or directly or indirectly wraps an object that does.
Throws:
  `java.sql.SQLException` - if an error occurs while determining whether this is a wrapper for an object with the given interface.
Since:
  1.6