Search in sources :

Example 11 with Type

use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.

the class JDBCResultSetMetaData method getColumnClassName.

//--------------------------JDBC 2.0-----------------------------------
/**
     * <!-- start generic documentation -->
     * <p>Returns the fully-qualified name of the Java class whose instances
     * are manufactured if the method <code>ResultSet.getObject</code>
     * is called to retrieve a value
     * from the column.  <code>ResultSet.getObject</code> may return a subclass of the
     * class returned by this method.
     * <!-- end generic documentation -->
     *
     * <!-- start Release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB 1.9.0 fully supports this feature.<p>
     *
     * For columns of type OTHER, there is no specific class name and
     * java.lang.Object is returned.
     *
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @param column the first column is 1, the second is 2, ...
     * @return the fully-qualified name of the class in the Java programming
     *         language that would be used by the method
     * <code>ResultSet.getObject</code> to retrieve the value in the specified
     * column. This is the class name used for custom mapping.
     * @exception SQLException if a database access error occurs
     * @since JDK 1.2 (JDK 1.1.x developers: read the overview for
     *      JDBCResultSet)
     */
public String getColumnClassName(int column) throws SQLException {
    checkColumn(column);
    Type type = resultMetaData.columnTypes[--column];
    return type.getJDBCClassName();
}
Also used : CharacterType(org.hsqldb_voltpatches.types.CharacterType) Type(org.hsqldb_voltpatches.types.Type)

Example 12 with Type

use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.

the class JDBCResultSetMetaData method getColumnDisplaySize.

/**
     * <!-- start generic documentation -->
     * Indicates the designated column's normal maximum width in characters.
     * <!-- end generic documentation -->
     *
     * <!-- start Release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB 1.9.0 fully supports this feature.  <p>
     *
     * The current calculation follows these rules: <p>
     *
     * <ol>
     * <li>Long character types and datetime types:<p>
     *
     *     The maximum length/precision, repectively.<p>
     *
     * <li>CHAR and VARCHAR types: <p>
     *
     *      <ul>
     *      <li> If the result set column is a direct pass through of a table
     *           column value and column size was declared, then the declared
     *           value is returned. <p>
     *
     *      <li> Otherwise, the computed length according to SQL Standard is
     *           returned. For very large values, the value of the system property
     *           hsqldb.max_xxxchar_display_size or the magic value
     *           32766 (0x7FFE) (tested usable/accepted by most tools and
     *           compatible with assumptions made by java.io read/write
     *           UTF) when the system property is not defined or is not
     *           accessible, due to security constraints. <p>
     *
     *      </ul>
     *
     *      It must be noted that the latter value in no way affects the
     *      ability of the HSQLDB JDBC driver to retrieve longer values
     *      and serves only as the current best effort at providing a
     *      value that maximizes usability across a wide range of tools,
     *      given that the HSQLDB database engine allows very large
     *      lengths to be declared. <p>
     *
     * <li>Number types: <p>
     *
     *     The max precision, plus the length of the negation character (1),
     *     plus (if applicable) the maximum number of characters that may
     *     occupy the exponent character sequence.  Note that some legacy tools
     *     do not correctly handle BIGINT values of greater than 18 digits. <p>
     *
     * <li>BOOLEAN type: <p>
     *
     *     The length of the character sequence "false" (5), the longer of the
     *     two boolean value String representations. <p>
     *
     * <li>Remaining types: <p>
     *
     *     The maximum length/precision, respectively, as reported by
     *     DatabaseMetaData.getTypeInfo(), when applicable.  If the maximum
     *     display size is unknown, unknowable or inapplicable, then zero is
     *     returned. <p>
     *
     * </ol>
     *
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @param column the first column is 1, the second is 2, ...
     * @return the normal maximum number of characters allowed as the width
     *          of the designated column
     * @exception SQLException if a database access error occurs
     */
public int getColumnDisplaySize(int column) throws SQLException {
    checkColumn(column);
    Type type = resultMetaData.columnTypes[--column];
    return type.displaySize();
}
Also used : CharacterType(org.hsqldb_voltpatches.types.CharacterType) Type(org.hsqldb_voltpatches.types.Type)

Example 13 with Type

use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.

the class JDBCResultSetMetaData method getColumnType.

/**
     * <!-- start generic documentation -->
     * Retrieves the designated column's SQL type.
     * <!-- end generic documentation -->
     *
     * <!-- start Release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * This reports the SQL type code of the column. For time and timestamp
     * types that are WITH TIME ZONE, the values as the SQL Standarc CLI
     * codes.<p>
     *
     * </div>
     * <!-- end release-specific documentation -->
     *
     *
     * @param column the first column is 1, the second is 2, ...
     * @return SQL type from java.sql.Types
     * @exception SQLException if a database access error occurs
     * @see java.sql.Types
     */
public int getColumnType(int column) throws SQLException {
    checkColumn(column);
    Type type = resultMetaData.columnTypes[--column];
    return type.getJDBCTypeCode();
}
Also used : CharacterType(org.hsqldb_voltpatches.types.CharacterType) Type(org.hsqldb_voltpatches.types.Type)

Example 14 with Type

use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.

the class JDBCResultSetMetaData method isSigned.

/**
     * <!-- start generic documentation -->
     * Indicates whether values in the designated column are signed numbers.
     * <!-- end generic documentation -->
     *
     * <!-- start Release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB 1.9.0 fully supports this feature.  <p>
     *
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @param column the first column is 1, the second is 2, ...
     * @return <code>true</code> if so; <code>false</code> otherwise
     * @exception SQLException if a database access error occurs
     */
public boolean isSigned(int column) throws SQLException {
    checkColumn(column);
    Type type = resultMetaData.columnTypes[--column];
    return type.isNumberType();
}
Also used : CharacterType(org.hsqldb_voltpatches.types.CharacterType) Type(org.hsqldb_voltpatches.types.Type)

Example 15 with Type

use of org.hsqldb_voltpatches.types.Type in project voltdb by VoltDB.

the class JDBCResultSetMetaData method isCaseSensitive.

/**
     * <!-- start generic documentation -->
     * Indicates whether a column's case matters.
     * <!-- end generic documentation -->
     *
     * <!-- start Release-specific documentation -->
     * <div class="ReleaseSpecificDocumentation">
     * <h3>HSQLDB-Specific Information:</h3> <p>
     *
     * HSQLDB 1.7.1 did not report this value accurately.  <p>
     *
     * Starting with 1.7.2, this feature is better supported.  <p>
     *
     * This method returns true for any column whose data type is a character
     * type, with the exception of VARCHAR_IGNORECASE for which it returns
     * false. It also returns false for any column whose data type is a
     * not a character data type. <p>
     *
     * </div>
     * <!-- end release-specific documentation -->
     *
     * @param column the first column is 1, the second is 2, ...
     * @return <code>true</code> if so; <code>false</code> otherwise
     * @exception SQLException if a database access error occurs
     */
public boolean isCaseSensitive(int column) throws SQLException {
    checkColumn(column);
    Type type = resultMetaData.columnTypes[--column];
    if (type.isCharacterType()) {
        return !((CharacterType) type).isCaseInsensitive();
    }
    return false;
}
Also used : CharacterType(org.hsqldb_voltpatches.types.CharacterType) Type(org.hsqldb_voltpatches.types.Type)

Aggregations

Type (org.hsqldb_voltpatches.types.Type)72 HsqlName (org.hsqldb_voltpatches.HsqlNameManager.HsqlName)20 CharacterType (org.hsqldb_voltpatches.types.CharacterType)20 NumberType (org.hsqldb_voltpatches.types.NumberType)14 SchemaObject (org.hsqldb_voltpatches.SchemaObject)11 Table (org.hsqldb_voltpatches.Table)9 Iterator (org.hsqldb_voltpatches.lib.Iterator)9 WrapperIterator (org.hsqldb_voltpatches.lib.WrapperIterator)9 IntervalType (org.hsqldb_voltpatches.types.IntervalType)9 Constraint (org.hsqldb_voltpatches.Constraint)8 PersistentStore (org.hsqldb_voltpatches.persist.PersistentStore)8 HsqlException (org.hsqldb_voltpatches.HsqlException)7 TextTable (org.hsqldb_voltpatches.TextTable)6 HsqlArrayList (org.hsqldb_voltpatches.lib.HsqlArrayList)6 DTIType (org.hsqldb_voltpatches.types.DTIType)6 ColumnSchema (org.hsqldb_voltpatches.ColumnSchema)4 DateTimeType (org.hsqldb_voltpatches.types.DateTimeType)4 OrderedHashSet (org.hsqldb_voltpatches.lib.OrderedHashSet)3 IOException (java.io.IOException)2 Method (java.lang.reflect.Method)2