FileDocCategorySizeDatePackage
SimpleTextDatabaseMetaData.javaAPI DocExample114855Sat Feb 03 11:43:40 GMT 2001jdbc.SimpleText

SimpleTextDatabaseMetaData

public class SimpleTextDatabaseMetaData extends SimpleTextObject implements DatabaseMetaData

Fields Summary
protected SimpleTextIConnection
ownerConnection
Constructors Summary
Methods Summary
protected voidadd(java.util.Hashtable h, int col, java.lang.String name, int type)

        h.put(new Integer(col), new SimpleTextColumn(name,type));
    
public booleanallProceduresAreCallable()

        // The SimpleText driver does not support callable statements, so
        // none are callable

        return false;
    
public booleanallTablesAreSelectable()

        // The SimpleText driver allows all tables returned by getTables
        // to be selected

        return true;
    
public booleandataDefinitionCausesTransactionCommit()

        // The SimpleText driver does not support transactions

        return false;
    
public booleandataDefinitionIgnoredInTransactions()

        // The SimpleText driver does not support transactions

        return false;
    
public booleandoesMaxRowSizeIncludeBlobs()

        return false;
    
public java.sql.ResultSetgetBestRowIdentifier(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable)

        if (traceOn()) {
            trace("@getBestRowIdentifier(" + catalog + ", " + schema + ", " +
                            table + ", " + scope + ", " + nullable + ")");
        }

        // The SimpleText driver does not support row identifiers.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "SCOPE", Types.SMALLINT);
        add(columns, 2, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 3, "DATA_TYPE", Types.SMALLINT);
        add(columns, 4, "TYPE_NAME", Types.VARCHAR);
        add(columns, 5, "COLUMN_SIZE", Types.INTEGER);
        add(columns, 6, "BUFFER_LENGTH", Types.INTEGER);
        add(columns, 7, "DECIMAL_DIGITS", Types.SMALLINT);
        add(columns, 8, "PSEUDO_COLUMN", Types.SMALLINT);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetCatalogSeparator()

        // The SimpleText driver supports specifying fully qualified
        // file names, so the catalog separator is the directory
        // separator

        return "/";
    
public java.lang.StringgetCatalogTerm()

        return "CATALOG";
    
public java.sql.ResultSetgetCatalogs()

        if (traceOn()) {
            trace("@getCatalogs");
        }

        // The SimpleText driver only supports one catalog - the current
        // directory for the connection

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create a Hashtable for a single row

        Hashtable singleRow = new Hashtable();

        // Set the value for column 1, which is the directory for the
        // connection

        singleRow.put (new Integer(1),
                new CommonValue(ownerConnection.getDirectory(null)));

        rows.put (new Integer(1), singleRow);

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetColumnPrivileges(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern)

        if (traceOn()) {
            trace("@getColumnPrivileges(" + catalog + ", " + schema + ", " +
                            table + ", " + columnNamePattern + ")");
        }

        // The SimpleText driver does not support column privileges.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "GRANTOR", Types.VARCHAR);
        add(columns, 6, "GRANTEE", Types.VARCHAR);
        add(columns, 7, "PRIVILEGE", Types.VARCHAR);
        add(columns, 8, "IS_GRANTABLE", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)

        if (traceOn()) {
            trace("@getColumns(" + catalog + ", " + schemaPattern +
                    ", " + tableNamePattern + ", " + columnNamePattern + ")");
        }

        // Create a statement object

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "DATA_TYPE", Types.SMALLINT);
        add(columns, 6, "TYPE_NAME", Types.VARCHAR);
        add(columns, 7, "COLUMN_SIZE", Types.INTEGER);
        add(columns, 8, "BUFFER_LENGTH", Types.INTEGER);
        add(columns, 9, "DECIMAL_DIGITS", Types.INTEGER);
        add(columns, 10, "NUM_PREC_RADIX", Types.INTEGER);
        add(columns, 11, "NULLABLE", Types.INTEGER);
        add(columns, 12, "REMARKS", Types.VARCHAR);
        add(columns, 13, "COLUMN_DEF", Types.VARCHAR);
        add(columns, 14, "SQL_DATA_TYPE", Types.INTEGER);
        add(columns, 15, "SQL_DATETIME_SUB", Types.INTEGER);
        add(columns, 16, "CHAR_OCTET_LENGTH", Types.INTEGER);
        add(columns, 17, "ORDINAL_POSITION", Types.INTEGER);
        add(columns, 18, "IS_NULLABLE", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Get a Hashtable will all tables

        Hashtable tables = ownerConnection.getTables(
                    ownerConnection.getDirectory(catalog), tableNamePattern);

        Hashtable singleRow;
        Hashtable columnList;
        SimpleTextTable table;
        SimpleTextColumn column;

        int count = 0;

        // Create a row for each column in each table in the Hashtable

        for (int i = 0; i < tables.size(); i++) {
            table = (SimpleTextTable) tables.get(new Integer(i));

            // Get the columns

            columnList = ownerConnection.getColumns(table.dir, table.name);

            if (columnList == null) {
                continue;
            }

            for (int ii = 1; ii <= columnList.size(); ii++) {

                column = (SimpleTextColumn) columnList.get(new Integer(ii));

                // Create a new Hashtable for a single row

                singleRow = new Hashtable();

                // Build the row
                singleRow.put(new Integer(1), new CommonValue(table.dir));
                singleRow.put(new Integer(3), new CommonValue(table.name));
                singleRow.put(new Integer(4), new CommonValue(column.name));
                singleRow.put(new Integer(5), new CommonValue(column.type));
                singleRow.put(new Integer(6),
                            new CommonValue(typeToName(column.type)));
                singleRow.put(new Integer(7),
                                    new CommonValue(column.precision));

                // Add it to the row list (column numbers are 1-based)
                count++;
                rows.put(new Integer(count), singleRow);
            }

        }

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetCrossReference(java.lang.String primaryCatalog, java.lang.String primarySchema, java.lang.String primaryTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable)

        if (traceOn()) {
            trace("@getCrossReference(" + primaryCatalog + ", " +
                    primarySchema + ", " + primaryTable + ", " +
                    foreignCatalog + ", " +    foreignSchema + ", " +
                    foreignTable + ")");
        }

        // The SimpleText driver does not support indexes.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "PKTABLE_CAT", Types.VARCHAR);
        add(columns, 2, "PKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "PKTABLE_NAME", Types.VARCHAR);
        add(columns, 4, "PKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "FKTABLE_CAT", Types.VARCHAR);
        add(columns, 6, "FKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 7, "FKTABLE_NAME", Types.VARCHAR);
        add(columns, 8, "FKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 9, "KEY_SEQ", Types.SMALLINT);
        add(columns, 10, "UPDATE_RULE", Types.SMALLINT);
        add(columns, 11, "DELETE_RULE", Types.SMALLINT);
        add(columns, 12, "FK_NAME", Types.VARCHAR);
        add(columns, 13, "PK_NAME", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetDatabaseProductName()

        return "Simple Text JDBC Driver";
    
public java.lang.StringgetDatabaseProductVersion()

        return "1.00";
    
public intgetDefaultTransactionIsolation()

        // The SimpleText driver does not support transactions

        return Connection.TRANSACTION_NONE;
    
public intgetDriverMajorVersion()

        return SimpleTextDefine.MAJOR_VERSION;
    
public intgetDriverMinorVersion()

        return SimpleTextDefine.MINOR_VERSION;
    
public java.lang.StringgetDriverName()

        return "SimpleText";
    
public java.lang.StringgetDriverVersion()

        String s = "";
        int minorVersion = getDriverMinorVersion();

        // Format the minor version to have 4 places, with leading 0's

        if (minorVersion < 1000) s += "0";
        if (minorVersion < 100) s += "0";
        if (minorVersion < 10) s += "0";
        s += "" + minorVersion;

        return "" + getDriverMajorVersion() + "." + s;
    
public java.sql.ResultSetgetExportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)

        if (traceOn()) {
            trace("@getExportedKeys(" + catalog + ", " + schema + ", " +
                            table + ")");
        }

        // The SimpleText driver does not support indexes.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "PKTABLE_CAT", Types.VARCHAR);
        add(columns, 2, "PKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "PKTABLE_NAME", Types.VARCHAR);
        add(columns, 4, "PKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "FKTABLE_CAT", Types.VARCHAR);
        add(columns, 6, "FKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 7, "FKTABLE_NAME", Types.VARCHAR);
        add(columns, 8, "FKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 9, "KEY_SEQ", Types.SMALLINT);
        add(columns, 10, "UPDATE_RULE", Types.SMALLINT);
        add(columns, 11, "DELETE_RULE", Types.SMALLINT);
        add(columns, 12, "FK_NAME", Types.VARCHAR);
        add(columns, 13, "PK_NAME", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetExtraNameCharacters()

        // The SimpleText driver does not allow any special characters
        // in indentifier names

        return "";
    
public java.lang.StringgetIdentifierQuoteString()

        // The SimpleText driver does not support quoting

        return " ";
    
public java.sql.ResultSetgetImportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)

        if (traceOn()) {
            trace("@getImportedKeys(" + catalog + ", " + schema + ", " +
                            table + ")");
        }

        // The SimpleText driver does not support indexes.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "PKTABLE_CAT", Types.VARCHAR);
        add(columns, 2, "PKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "PKTABLE_NAME", Types.VARCHAR);
        add(columns, 4, "PKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "FKTABLE_CAT", Types.VARCHAR);
        add(columns, 6, "FKTABLE_SCHEM", Types.VARCHAR);
        add(columns, 7, "FKTABLE_NAME", Types.VARCHAR);
        add(columns, 8, "FKCOLUMN_NAME", Types.VARCHAR);
        add(columns, 9, "KEY_SEQ", Types.SMALLINT);
        add(columns, 10, "UPDATE_RULE", Types.SMALLINT);
        add(columns, 11, "DELETE_RULE", Types.SMALLINT);
        add(columns, 12, "FK_NAME", Types.VARCHAR);
        add(columns, 13, "PK_NAME", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetIndexInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate)

        if (traceOn()) {
            trace("@getIndexInfo(" + catalog + ", " + schema + ", " +
                    table + ", " + unique + ", " + approximate + ")");
        }

        // The SimpleText driver does not support indexes.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "NON_UNIQUE", Types.BIT);
        add(columns, 5, "INDEX_CAT", Types.VARCHAR);
        add(columns, 6, "INDEX_NAME", Types.VARCHAR);
        add(columns, 7, "TYPE", Types.SMALLINT);
        add(columns, 8, "ORDINAL_POSITION", Types.SMALLINT);
        add(columns, 9, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 10, "ASC_OR_DESC", Types.VARCHAR);
        add(columns, 11, "CARDINALITY", Types.INTEGER);
        add(columns, 12, "PAGES", Types.INTEGER);
        add(columns, 13, "FILTER_CONDITION", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public intgetMaxBinaryLiteralLength()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxCatalogNameLength()

        return SimpleTextDefine.MAX_CATALOG_NAME_LEN;
    
public intgetMaxCharLiteralLength()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxColumnNameLength()

        return SimpleTextDefine.MAX_COLUMN_NAME_LEN;
    
public intgetMaxColumnsInGroupBy()

        // The SimpleText driver does not support GROUP BY

        return 0;
    
public intgetMaxColumnsInIndex()

        // The SimpleText driver does not support indexes

        return 0;
    
public intgetMaxColumnsInOrderBy()

        // The SimpleText driver does not support ORDER BY

        return 0;
    
public intgetMaxColumnsInSelect()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxColumnsInTable()

        return SimpleTextDefine.MAX_COLUMNS_IN_TABLE;
    
public intgetMaxConnections()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxCursorNameLength()

        // The SimpleText driver does not support named cursors

        return 0;
    
public intgetMaxIndexLength()

        // The SimpleText driver does not support indexes

        return 0;
    
public intgetMaxProcedureNameLength()

        // The SimpleText driver does not support stored procedures

        return 0;
    
public intgetMaxRowSize()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxSchemaNameLength()

        // The SimpleText driver does not support schemas

        return 0;
    
public intgetMaxStatementLength()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxStatements()

        // The SimpleText driver does not have a limit.  0 indicates no
        // limit, or the limit is not known.

        return 0;
    
public intgetMaxTableNameLength()

        return SimpleTextDefine.MAX_TABLE_NAME_LEN;
    
public intgetMaxTablesInSelect()

        // The SimpleText driver does not support joins, so only 1 table
        // is allowed to be specified in a SELECT statement

        return 1;
    
public intgetMaxUserNameLength()

        // The SimpleText driver does not support users

        return 0;
    
public java.lang.StringgetNumericFunctions()

        // The SimpleText driver does not support any math functions

        return "";
    
public java.sql.ResultSetgetPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table)

        if (traceOn()) {
            trace("@getPrimaryKeys(" + catalog + ", " + schema + ", " +
                            table + ")");
        }

        // The SimpleText driver does not support indexes.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "KEY_SEQ", Types.SMALLINT);
        add(columns, 6, "PK_NAME", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetProcedureColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern)

        if (traceOn()) {
            trace("@getProcedureColumns(" + catalog + ", " + schemaPattern +
                    ", " + procedureNamePattern + ", " +
                    columnNamePattern + ")");
        }

        // The SimpleText driver does not support procedures.  Instead of
        // throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "PROCEDURE_CAT", Types.VARCHAR);
        add(columns, 2, "PROCEDURE_SCHEM", Types.VARCHAR);
        add(columns, 3, "PROCEDURE_NAME", Types.VARCHAR);
        add(columns, 4, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "COLUMN_TYPE", Types.SMALLINT);
        add(columns, 6, "DATA_TYPE", Types.SMALLINT);
        add(columns, 7, "TYPE_NAME", Types.VARCHAR);
        add(columns, 8, "PRECISION", Types.INTEGER);
        add(columns, 9, "LENGTH", Types.INTEGER);
        add(columns, 10, "LENGTH", Types.SMALLINT);
        add(columns, 11, "RADIX", Types.SMALLINT);
        add(columns, 12, "NULLABLE", Types.SMALLINT);
        add(columns, 13, "REMARKS", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetProcedureTerm()

        return "PROCEDURE";
    
public java.sql.ResultSetgetProcedures(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern)

        if (traceOn()) {
            trace("@getProcedures(" + catalog + ", " + schemaPattern + ", " +
                    procedureNamePattern + ")");
        }

        // The SimpleText driver does not support procedures.  Instead of
        // throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "PROCEDURE_CAT", Types.VARCHAR);
        add(columns, 2, "PROCEDURE_SCHEM", Types.VARCHAR);
        add(columns, 3, "PROCEDURE_NAME", Types.VARCHAR);
        add(columns, 4, "REMARKS", Types.VARCHAR);
        add(columns, 5, "PROCEDURE_TYPE", Types.SMALLINT);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetSQLKeywords()

        return "";
    
public java.lang.StringgetSchemaTerm()

        return "SCHEMA";
    
public java.sql.ResultSetgetSchemas()

        if (traceOn()) {
            trace("@getSchemas");
        }

        // The SimpleText driver does not support schemas.  Instead of
        // throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_SCHEM", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetSearchStringEscape()

        // The SimpleText driver does not support search patterns, so
        // return an empty string

        return "";
    
public java.lang.StringgetStringFunctions()

        // The SimpleText driver does not support any String functions

        return "";
    
public java.lang.StringgetSystemFunctions()

        // The SimpleText driver does not support any System functions

        return "";
    
public java.sql.ResultSetgetTablePrivileges(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern)

        if (traceOn()) {
            trace("@getTablePrivileges(" + catalog + ", " + schemaPattern +
                            ", " + tableNamePattern + ")");
        }

        // The SimpleText driver does not support table privileges.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 5, "GRANTOR", Types.VARCHAR);
        add(columns, 6, "GRANTEE", Types.VARCHAR);
        add(columns, 7, "PRIVILEGE", Types.VARCHAR);
        add(columns, 8, "IS_GRANTABLE", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetTableTypes()

        if (traceOn()) {
            trace("@getTableTypes");
        }

        // The SimpleText driver only supports one table type - TABLE

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_TYPE", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create a Hashtable for a single row

        Hashtable singleRow = new Hashtable();

        // Set the value for column 1, which is the only table type - TABLE

        singleRow.put (new Integer(1), new CommonValue("TABLE"));

        rows.put (new Integer(1), singleRow);

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.sql.ResultSetgetTables(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types)

        if (traceOn()) {
            trace("@getTables(" + catalog + ", " + schemaPattern +
                    ", " + tableNamePattern + ")");
        }

        // Create a statement object

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TABLE_CAT", Types.VARCHAR);
        add(columns, 2, "TABLE_SCHEM", Types.VARCHAR);
        add(columns, 3, "TABLE_NAME", Types.VARCHAR);
        add(columns, 4, "TABLE_TYPE", Types.VARCHAR);
        add(columns, 5, "REMARKS", Types.VARCHAR);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // If any of the parameters will return an empty result set, do so

        boolean willBeEmpty = false;

        // If table types are specified, make sure that 'TABLE' is
        // included.  If not, no rows will be returned

        if (types != null) {
            willBeEmpty = true;
            for (int ii = 0; ii < types.length; ii++) {
                if (types[ii].equalsIgnoreCase("TABLE")) {
                    willBeEmpty = false;
                    break;
                }
            }
        }

        if (!willBeEmpty) {

            // Get a Hashtable will all tables

            Hashtable tables = ownerConnection.getTables(
                    ownerConnection.getDirectory(catalog), tableNamePattern);

            Hashtable singleRow;
            SimpleTextTable table;

            // Create a row for each table in the Hashtable

            for (int i = 0; i < tables.size(); i++) {
                table = (SimpleTextTable) tables.get(new Integer(i));

                // Create a new Hashtable for a single row

                singleRow = new Hashtable();

                // Build the row
                singleRow.put(new Integer(1), new CommonValue(table.dir));
                singleRow.put(new Integer(3), new CommonValue(table.name));
                singleRow.put(new Integer(4), new CommonValue("TABLE"));

                // Add it to the row list
                rows.put(new Integer(i + 1), singleRow);
            }
        }

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetTimeDateFunctions()

        // The SimpleText driver does not support any Time or Date functions

        return "";
    
public java.sql.ResultSetgetTypeInfo()

        if (traceOn()) {
            trace("@getTableTypes");
        }

        // The SimpleText driver only supports the following data types:
        //
        //    VARCHAR
        //    INTEGER
        //    VARBINARY

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "TYPE_NAME", Types.VARCHAR);
        add(columns, 2, "DATA_TYPE", Types.SMALLINT);
        add(columns, 3, "PRECISION", Types.INTEGER);
        add(columns, 4, "LITERAL_PREFIX", Types.VARCHAR);
        add(columns, 5, "LITERAL_SUFFIX", Types.VARCHAR);
        add(columns, 6, "CREATE_PARAMS", Types.VARCHAR);
        add(columns, 7, "NULLABLE", Types.SMALLINT);
        add(columns, 8, "CASE_SENSITIVE", Types.BIT);
        add(columns, 9, "SEARCHABLE", Types.SMALLINT);
        add(columns, 10, "UNSIGNED_ATTRIBUTE", Types.BIT);
        add(columns, 11, "FIXED_PREC_SCALE", Types.BIT);
        add(columns, 12, "AUTO_INCREMENT", Types.BIT);
        add(columns, 13, "LOCAL_TYPE_NAME", Types.VARCHAR);
        add(columns, 14, "MINIMUM_SCALE", Types.SMALLINT);
        add(columns, 15, "MAXIMUM_SCALE", Types.SMALLINT);
        add(columns, 16, "SQL_DATA_TYPE", Types.INTEGER);
        add(columns, 17, "SQL_DATETIME_SUB", Types.INTEGER);
        add(columns, 18, "NUM_PREC_RADIX", Types.INTEGER);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create a Hashtable for a single row

        Hashtable singleRow;

        // Create the VARCHAR entry

        singleRow = new Hashtable();
        singleRow.put(new Integer(1),
                    new CommonValue(typeToName(Types.VARCHAR)));
        singleRow.put(new Integer(2), new CommonValue(Types.VARCHAR));
        singleRow.put(new Integer(3),
                    new CommonValue(SimpleTextDefine.MAX_VARCHAR_LEN));
        singleRow.put(new Integer(4), new CommonValue("'"));
        singleRow.put(new Integer(5), new CommonValue("'"));
        singleRow.put(new Integer(7), new CommonValue(typeNoNulls));
        singleRow.put(new Integer(9), new CommonValue(typePredBasic));
        singleRow.put(new Integer(13),
                    new CommonValue(typeToName(Types.VARCHAR)));
        rows.put (new Integer(1), singleRow);

        // Create the INTEGER entry

        singleRow = new Hashtable();
        singleRow.put(new Integer(1),
                    new CommonValue(typeToName(Types.INTEGER)));
        singleRow.put(new Integer(2), new CommonValue(Types.INTEGER));
        singleRow.put(new Integer(3),
                    new CommonValue(SimpleTextDefine.MAX_INTEGER_LEN));
        singleRow.put(new Integer(7), new CommonValue(typeNoNulls));
        singleRow.put(new Integer(9), new CommonValue(typePredBasic));
        singleRow.put(new Integer(13),
                    new CommonValue(typeToName(Types.INTEGER)));
        rows.put (new Integer(2), singleRow);

        // Create the VARBINARY entry

        singleRow = new Hashtable();
        singleRow.put(new Integer(1),
                    new CommonValue(typeToName(Types.VARBINARY)));
        singleRow.put(new Integer(2), new CommonValue(Types.VARBINARY));
        singleRow.put(new Integer(3),
                    new CommonValue(SimpleTextDefine.MAX_VARBINARY_LEN));
        singleRow.put(new Integer(4), new CommonValue("'"));
        singleRow.put(new Integer(5), new CommonValue("'"));
        singleRow.put(new Integer(7), new CommonValue(typeNoNulls));
        singleRow.put(new Integer(9), new CommonValue(typePredNone));
        singleRow.put(new Integer(13),
                    new CommonValue(typeToName(Types.VARBINARY)));
        rows.put (new Integer(3), singleRow);

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public java.lang.StringgetURL()

        // Can't generate a URL

        return null;
    
public java.lang.StringgetUserName()

        // The SimpleText driver does not support user names

        return "";
    
public java.sql.ResultSetgetVersionColumns(java.lang.String catalog, java.lang.String schema, java.lang.String table)

        if (traceOn()) {
            trace("@getVersionColumns(" + catalog + ", " + schema + ", " +
                            table + ")");
        }

        // The SimpleText driver does not support version columns.  Instead
        // of throwing a 'Driver not capable' SQLException, we'll be
        // graceful and return an empty result set

        SimpleTextStatement stmt =
                (SimpleTextStatement) ownerConnection.createStatement();

        // Create a Hashtable for all of the columns

        Hashtable columns = new Hashtable();

        add(columns, 1, "SCOPE", Types.SMALLINT);
        add(columns, 2, "COLUMN_NAME", Types.VARCHAR);
        add(columns, 3, "DATA_TYPE", Types.SMALLINT);
        add(columns, 4, "TYPE_NAME", Types.VARCHAR);
        add(columns, 5, "COLUMN_SIZE", Types.INTEGER);
        add(columns, 6, "BUFFER_LENGTH", Types.INTEGER);
        add(columns, 7, "DECIMAL_DIGITS", Types.SMALLINT);
        add(columns, 8, "PSEUDO_COLUMN", Types.SMALLINT);

        // Create an empty Hashtable for the rows

        Hashtable rows = new Hashtable();

        // Create the ResultSet object and return it

        SimpleTextResultSet rs = new SimpleTextResultSet();

        rs.initialize(stmt, columns, rows);

        return rs;
    
public voidinitialize(SimpleTextIConnection con)

        // Save the owning connection object

        ownerConnection = con;
    
public booleanisCatalogAtStart()

        // The SimpleText driver supports specifying fully qualified
        // file names, so the catalog (directory) is specified first

        return true;
    
public booleanisReadOnly()

        return ownerConnection.isReadOnly();
    
public booleannullPlusNonNullIsNull()

        // The SimpleText driver does not support nulls

        return false;
    
public booleannullsAreSortedAtEnd()

        // The SimpleText driver does not support nulls (or sorting, for
        // that matter)

        return false;
    
public booleannullsAreSortedAtStart()

        // The SimpleText driver does not support nulls (or sorting, for
        // that matter)

        return false;
    
public booleannullsAreSortedHigh()

        // The SimpleText driver does not support nulls (or sorting, for
        // that matter)

        return false;
    
public booleannullsAreSortedLow()

        // The SimpleText driver does not support nulls (or sorting, for
        // that matter)

        return false;
    
public booleanstoresLowerCaseIdentifiers()

        return false;
    
public booleanstoresLowerCaseQuotedIdentifiers()

        return false;
    
public booleanstoresMixedCaseIdentifiers()

        return false;
    
public booleanstoresMixedCaseQuotedIdentifiers()

        return false;
    
public booleanstoresUpperCaseIdentifiers()

        return true;
    
public booleanstoresUpperCaseQuotedIdentifiers()

        return true;
    
public booleansupportsANSI92EntryLevelSQL()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsANSI92FullSQL()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsANSI92IntermediateSQL()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsAlterTableWithAddColumn()

        // The SimpleText driver does not support ALTER TABLE at all

        return false;
    
public booleansupportsAlterTableWithDropColumn()

        // The SimpleText driver does not support ALTER TABLE at all

        return false;
    
public booleansupportsCatalogsInDataManipulation()

        // The SimpleText driver does support catalogs (path names)

        return true;
    
public booleansupportsCatalogsInIndexDefinitions()

        // The SimpleText driver does not support indexes

        return false;
    
public booleansupportsCatalogsInPrivilegeDefinitions()

        // The SimpleText driver does not support privileges

        return false;
    
public booleansupportsCatalogsInProcedureCalls()

        // The SimpleText driver does not support stored procedures

        return false;
    
public booleansupportsCatalogsInTableDefinitions()

        // The SimpleText driver does support catalogs (path names)

        return true;
    
public booleansupportsColumnAliasing()

        // The SimpleText driver does not support column alias names

        return false;
    
public booleansupportsConvert()

        // The SimpleText driver does not support the CONVERT function

        return false;
    
public booleansupportsConvert(int fromType, int toType)

        // The SimpleText driver does not support the CONVERT function

        return false;
    
public booleansupportsCoreSQLGrammar()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsCorrelatedSubqueries()

        // The SimpleText driver does not support subqueries

        return false;
    
public booleansupportsDataDefinitionAndDataManipulationTransactions()

        // The SimpleText driver does not support transactions

        return false;
    
public booleansupportsDataManipulationTransactionsOnly()

        // The SimpleText driver does not support transactions

        return false;
    
public booleansupportsDifferentTableCorrelationNames()

        // The SimpleText driver does not support table correlation names

        return false;
    
public booleansupportsExpressionsInOrderBy()

        // The SimpleText driver does not support ORDER BY

        return false;
    
public booleansupportsExtendedSQLGrammar()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsFullOuterJoins()

        // The SimpleText driver does not support outer joins

        return false;
    
public booleansupportsGroupBy()

        // The SimpleText driver does not support GROUP BY

        return false;
    
public booleansupportsGroupByBeyondSelect()

        // The SimpleText driver does not support GROUP BY

        return false;
    
public booleansupportsGroupByUnrelated()

        // The SimpleText driver does not support GROUP BY

        return false;
    
public booleansupportsIntegrityEnhancementFacility()

        // The SimpleText driver does support referential integrity

        return false;
    
public booleansupportsLikeEscapeClause()

        // The SimpleText driver does not support the LIKE clause

        return false;
    
public booleansupportsLimitedOuterJoins()

        // The SimpleText driver does not support outer joins

        return false;
    
public booleansupportsMinimumSQLGrammar()

        // The SimpleText driver does not even support the most minimum
        // SQL grammar

        return false;
    
public booleansupportsMixedCaseIdentifiers()

        return true;
    
public booleansupportsMixedCaseQuotedIdentifiers()

        return true;
    
public booleansupportsMultipleResultSets()

        // The SimpleText driver does not support multiple result sets

        return false;
    
public booleansupportsMultipleTransactions()

        // The SimpleText driver does not support transactions

        return false;
    
public booleansupportsNonNullableColumns()

        // The SimpleText driver does not support nulls, so all columns by
        // default are non-nullable.  This, however, specifies whether the
        // column can be defined as NON NULL in the DDL (Data Definition
        // Language) statement, which is not supported.

        return false;
    
public booleansupportsOpenCursorsAcrossCommit()

        // The SimpleText driver does not support transactions; it is
        // always in auto-commit mode.  The cursor remains open after
        // a transaction is auto-committed

        return true;
    
public booleansupportsOpenCursorsAcrossRollback()

        // The SimpleText driver does not support transactions; it is
        // always in auto-commit mode.  The cursor remains open after
        // a transaction is auto-committed.  A rollback has no effect.

        return true;
    
public booleansupportsOpenStatementsAcrossCommit()

        // The SimpleText driver does not support transactions; it is
        // always in auto-commit mode.  The statement remains open after
        // a transaction is auto-committed

        return true;
    
public booleansupportsOpenStatementsAcrossRollback()

        // The SimpleText driver does not support transactions; it is
        // always in auto-commit mode.  The statement remains open after
        // a transaction is auto-committed.  A rollback has no effect.

        return true;
    
public booleansupportsOrderByUnrelated()

        // The SimpleText driver does not support ORDER BY

        return false;
    
public booleansupportsOuterJoins()

        // The SimpleText driver does not support outer joins

        return false;
    
public booleansupportsPositionedDelete()

        // The SimpleText driver does not support positioned deletes

        return false;
    
public booleansupportsPositionedUpdate()

        // The SimpleText driver does not support positioned updates

        return false;
    
public booleansupportsSchemasInDataManipulation()

        // The SimpleText driver does not support schemas

        return false;
    
public booleansupportsSchemasInIndexDefinitions()

        // The SimpleText driver does not support schemas

        return false;
    
public booleansupportsSchemasInPrivilegeDefinitions()

        // The SimpleText driver does not support schemas

        return false;
    
public booleansupportsSchemasInProcedureCalls()

        // The SimpleText driver does not support schemas

        return false;
    
public booleansupportsSchemasInTableDefinitions()

        // The SimpleText driver does not support schemas

        return false;
    
public booleansupportsSelectForUpdate()

        // The SimpleText driver does not support the FOR UPDATE clause

        return false;
    
public booleansupportsStoredProcedures()

        // The SimpleText driver does not support stored procedures

        return false;
    
public booleansupportsSubqueriesInComparisons()

        // The SimpleText driver does not support subqueries

        return false;
    
public booleansupportsSubqueriesInExists()

        // The SimpleText driver does not support subqueries

        return false;
    
public booleansupportsSubqueriesInIns()

        // The SimpleText driver does not support subqueries

        return false;
    
public booleansupportsSubqueriesInQuantifieds()

        // The SimpleText driver does not support subqueries

        return false;
    
public booleansupportsTableCorrelationNames()

        // The SimpleText driver does not support table correlation names

        return false;
    
public booleansupportsTransactionIsolationLevel(int level)

        // The SimpleText driver does not support transaction.  Return
        // false for any level except for TRANSACTION_NONE

        boolean rc = false;
        if (level == Connection.TRANSACTION_NONE) {
            rc = true;
        }
        return rc;
    
public booleansupportsTransactions()

        // The SimpleText driver does not support transactions

        return false;
    
public booleansupportsUnion()

        // The SimpleText driver does not support unions

        return false;
    
public booleansupportsUnionAll()

        // The SimpleText driver does not support unions

        return false;
    
protected java.lang.StringtypeToName(int type)

        String s = "";

        switch(type) {
        case Types.VARCHAR:
            s = "VARCHAR";
            break;
        case Types.INTEGER:
            s = "INTEGER";
            break;
        case Types.VARBINARY:
            s = "BINARY";
            break;
        }
        return s;
    
public booleanusesLocalFilePerTable()

        // The SimpleText driver uses a file for each table

        return true;
    
public booleanusesLocalFiles()

        // The SimpleText driver stores all database data in files

        return true;