Package org.hsqldb_voltpatches

Examples of org.hsqldb_voltpatches.ColumnSchema


    }

    protected final void addColumn(Table t, String name, Type type) {

        HsqlName     cn;
        ColumnSchema c;

        cn = database.nameManager.newInfoSchemaColumnName(name, t.getName());
        c  = new ColumnSchema(cn, type, true, false, null);

        t.addColumn(c);
    }
View Full Code Here


            scope  = ti.getBRIScope();
            pseudo = ti.getBRIPseudo();

            for (int i = 0; i < cols.length; i++) {
                ColumnSchema column = table.getColumn(i);

                row                  = t.getEmptyRowData();
                row[iscope]          = scope;
                row[icolumn_name]    = column.getName().name;
                row[idata_type] = ValuePool.getInt(types[i].getJDBCTypeCode());
                row[itype_name]      = types[i].getNameString();
                row[icolumn_size]    = types[i].getJDBCPrecision();
                row[ibuffer_length= null;
                row[idecimal_digits] = types[i].getJDBCScale();
                row[ipseudo_column= pseudo;
                row[itable_cat]      = tableCatalog;
                row[itable_schem]    = tableSchema;
                row[itable_name]     = tableName;
                row[inullable]       = column.getNullability();
                row[iinKey]          = inKey;

                t.insertSys(store, row);
            }
        }
View Full Code Here

            columnCount  = table.getColumnCount();

            Type[] types = table.getColumnTypes();

            for (int i = 0; i < columnCount; i++) {
                ColumnSchema column = table.getColumn(i);

                row = t.getEmptyRowData();

                //
                row[itable_cat]         = tableCatalog;
                row[itable_schem]       = tableSchema;
                row[itable_name]        = tableName;
                row[icolumn_name]       = column.getName().name;
                row[idata_type]         = types[i].getJDBCTypeCode();
                row[itype_name]         = types[i].getNameString();
                row[icolumn_size]       = types[i].getJDBCPrecision();
                row[ibuffer_length]     = null;
                row[idecimal_digits]    = types[i].getJDBCScale();
                row[inum_prec_radix]    = ti.getColPrecRadix(i);
                row[inullable]          = column.getNullability();
                row[iremark]            = ti.getColRemarks(i);
                row[icolumn_def]        = column.getDefaultSQL();
                row[isql_data_type]     = types[i].getJDBCTypeCode();
                row[isql_datetime_sub= ti.getColSqlDateTimeSub(i);
                row[ichar_octet_length] = ti.getColCharOctLen(i);
                row[iordinal_position= ValuePool.getInt(i + 1);
                row[iis_nullable]       = ti.getColIsNullable(i);
View Full Code Here

     */
    Integer getColBufLen(int i) {

        int          size;
        int          type;
        ColumnSchema column;

        column = table.getColumn(i);
        type   = column.getDataType().getJDBCTypeCode();

        switch (type) {

            case Types.SQL_CHAR :
            case Types.SQL_CLOB :
            case Types.VARCHAR_IGNORECASE :
            case Types.SQL_VARCHAR : {
                size = column.getDataType().precision > Integer.MAX_VALUE
                       ? Integer.MAX_VALUE
                       : (int) column.getDataType().precision;

                if (size == 0) {}
                else if (size > HALF_MAX_INT) {
                    size = 0;
                } else {
                    size = 2 * size;
                }

                break;
            }
            case Types.SQL_BINARY :
            case Types.SQL_BLOB :
            case Types.SQL_VARBINARY : {
                size = column.getDataType().precision > Integer.MAX_VALUE
                       ? Integer.MAX_VALUE
                       : (int) column.getDataType().precision;

                break;
            }
            case Types.SQL_BIGINT :
            case Types.SQL_DOUBLE :
View Full Code Here

     */
    Integer getColCharOctLen(int i) {

        int          size;
        int          type;
        ColumnSchema column;

        column = table.getColumn(i);
        type   = column.getDataType().getJDBCTypeCode();

        switch (type) {

            case Types.SQL_CHAR :
            case Types.SQL_CLOB :
            case Types.VARCHAR_IGNORECASE :
            case Types.SQL_VARCHAR : {
                size = column.getDataType().precision > Integer.MAX_VALUE
                       ? Integer.MAX_VALUE
                       : (int) column.getDataType().precision;

                if (size == 0) {}
                else if (size > HALF_MAX_INT) {
                    size = 0;
                } else {
View Full Code Here

     * @param i zero-based column index
     * @return the nullability of the specified column
     */
    String getColIsNullable(int i) {

        ColumnSchema column = table.getColumn(i);

        return (column.isNullable() && !column.isPrimaryKey()) ? "YES"
                                                               : "NO";
    }
View Full Code Here

     * @param i zero-based column index
     * @return the specified column's nullablilit
     */
    Integer getColNullability(int i) {

        ColumnSchema column = table.getColumn(i);

        return (column.isNullable() && !column.isPrimaryKey())
               ? ValuePool.getInt(DITypeInfo.columnNullable)
               : ValuePool.getInt(DITypeInfo.columnNoNulls);
    }
View Full Code Here

     * @return the fixed number of digits to the right of the decimal point
     * for exact numeric types.
     */
    Integer getColScaleOrNull(int i) {

        ColumnSchema column;
        int          type;

        column = table.getColumn(i);
        type   = column.getDataType().getJDBCTypeCode();

        return Types.acceptsScaleCreateParam(type)
               ? ValuePool.getInt(column.getDataType().scale)
               : null;
    }
View Full Code Here

     * @return the declared or maximum length/precision for
     *    the specified column
     */
    Integer getColSize(int i) {

        ColumnSchema column;
        int          type;
        int          size;

        column = table.getColumn(i);
        type   = column.getDataType().getJDBCTypeCode();

        if (!Types.acceptsPrecision(type)) {
            return null;
        }

        size = column.getDataType().precision > Integer.MAX_VALUE
               ? Integer.MAX_VALUE
               : (int) column.getDataType().precision;

        if (size > 0) {
            return ValuePool.getInt(size);
        } else {
            ti.setTypeCode(type);
View Full Code Here

                             : i;
            Object o = data[j];
            Type   t = types[j];

            if (cols != null) {
                ColumnSchema col = (ColumnSchema) cols.get(j);

                writeFieldPrefix();
                writeString(col.getName().statementName);
            }

            if (o == null) {
                writeNull(t);
View Full Code Here

TOP

Related Classes of org.hsqldb_voltpatches.ColumnSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.