Package org.hsqldb.persist

Examples of org.hsqldb.persist.TextCache


        PersistentStore store =
            database.persistentStoreCollection.getStore(this);

        this.store = store;

        TextCache      cache  = null;
        TextFileReader reader = null;

        try {
            cache = (TextCache) database.logger.openTextFilePersistence(this,
                    dataSource, withReadOnlyData, isReversed);

            store.setCache(cache);

            reader = cache.getTextFileReader();

            // read and insert all the rows from the source file
            Row row     = null;
            long nextpos = 0;

            if (cache.isIgnoreFirstLine()) {
                nextpos += reader.readHeaderLine();
                cache.setHeaderInitialise(reader.getHeaderLine());
            }

            while (true) {
                RowInputInterface rowIn = reader.readObject(nextpos);
View Full Code Here


    public void setHeader(String header) {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache = (TextCache) store.getCache();

        if (cache != null && cache.isIgnoreFirstLine()) {
            cache.setHeader(header);

            return;
        }

        throw Error.error(ErrorCode.TEXT_TABLE_HEADER);
View Full Code Here

    private String getHeader() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache  = (TextCache) store.getCache();
        String    header = cache == null ? null
                                         : cache.getHeader();

        return header == null ? null
                              : StringConverter.toQuotedString(header, '\'',
                              true);
    }
View Full Code Here

            row[itable_cat]   = database.getCatalogName().name;
            row[itable_schem] = table.getSchemaName().name;
            row[itable_name= table.getName().name;
            row[idsd]         = ((TextTable) table).getDataSource();

            TextCache cache = (TextCache) currentStore.getCache();

            if (cache != null) {
                row[ifile_path] =
                    FileUtil.getDefaultInstance().canonicalOrAbsolutePath(
                        cache.getFileName());
                row[ifile_enc] = cache.stringEncoding;
                row[ifs]       = cache.fs;
                row[ivfs]      = cache.vs;
                row[ilvfs]     = cache.lvs;
                row[iif]       = ValuePool.getBoolean(cache.ignoreFirst);
View Full Code Here

    public void setHeader(String header) {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache = (TextCache) store.getCache();

        if (cache != null && cache.ignoreFirst) {
            cache.setHeader(header);

            return;
        }

        throw Error.error(ErrorCode.TEXT_TABLE_HEADER);
View Full Code Here

    public String getHeader() {

        PersistentStore store =
            database.persistentStoreCollection.getStore(this);
        TextCache cache  = (TextCache) store.getCache();
        String    header = cache == null ? null
                                         : cache.getHeader();

        return header == null ? null
                              : StringConverter.toQuotedString(header, '\"',
                              true);
    }
View Full Code Here

        Iterator tables;
        Table    table;
        Object[] row;

//        DITableInfo ti;
        TextCache tc;

        // column number mappings
        final int itable_cat   = 0;
        final int itable_schem = 1;
        final int itable_name  = 2;
        final int idsd         = 3;
        final int ifile_path   = 4;
        final int ifile_enc    = 5;
        final int ifs          = 6;
        final int ivfs         = 7;
        final int ilvfs        = 8;
        final int iif          = 9;
        final int iiq          = 10;
        final int iiaq         = 11;
        final int iid          = 12;

        // Initialization
        tables = database.schemaManager.allTablesIterator();

        // Do it.
        while (tables.hasNext()) {
            table = (Table) tables.next();

            if (!table.isText() || !isAccessibleTable(table)) {
                continue;
            }

            row               = t.getEmptyRowData();
            row[itable_cat]   = ns.getCatalogName(table);
            row[itable_schem] = table.getSchemaName();
            row[itable_name= table.getName().name;
            row[idsd]         = table.getDataSource();

            if (table.getCache() instanceof TextCache) {
                tc = (TextCache) table.getCache();
                row[ifile_path] =
                    FileUtil.canonicalOrAbsolutePath(tc.getFileName());
                row[ifile_enc] = tc.stringEncoding;
                row[ifs]       = tc.fs;
                row[ivfs]      = tc.vs;
                row[ilvfs]     = tc.lvs;
                row[iif]       = ValuePool.getBoolean(tc.ignoreFirst);
View Full Code Here

        Iterator tables;
        Table    table;
        Object[] row;

//        DITableInfo ti;
        TextCache tc;

        // column number mappings
        final int itable_cat   = 0;
        final int itable_schem = 1;
        final int itable_name  = 2;
        final int idsd         = 3;
        final int ifile_path   = 4;
        final int ifile_enc    = 5;
        final int ifs          = 6;
        final int ivfs         = 7;
        final int ilvfs        = 8;
        final int iif          = 9;
        final int iiq          = 10;
        final int iiaq         = 11;
        final int iid          = 12;

        // Initialization
        tables = database.schemaManager.allTablesIterator();

        // Do it.
        while (tables.hasNext()) {
            table = (Table) tables.next();

            if (!table.isText() ||!isAccessibleTable(table)) {
                continue;
            }

            row               = t.getEmptyRowData();
            row[itable_cat]   = ns.getCatalogName(table);
            row[itable_schem] = table.getSchemaName();
            row[itable_name= table.getName().name;

            if (table.getCache() != null
                    && table.getCache() instanceof TextCache) {
                tc        = (TextCache) table.getCache();
                row[idsd] = table.getDataSource();
                row[ifile_path] =
                    FileUtil.canonicalOrAbsolutePath(tc.getFileName());
                row[ifile_enc] = tc.stringEncoding;
                row[ifs]       = tc.fs;
                row[ivfs]      = tc.vs;
                row[ilvfs]     = tc.lvs;
                row[iif]       = ValuePool.getBoolean(tc.ignoreFirst);
View Full Code Here

      arrayOfObject[1] = localTable2.getSchemaName();
      arrayOfObject[2] = localTable2.getName().name;
      arrayOfObject[3] = localTable2.getDataSource();
      if ((localTable2.getCache() instanceof TextCache))
      {
        TextCache localTextCache = (TextCache)localTable2.getCache();
        arrayOfObject[4] = FileUtil.canonicalOrAbsolutePath(localTextCache.getFileName());
        arrayOfObject[5] = localTextCache.stringEncoding;
        arrayOfObject[6] = localTextCache.fs;
        arrayOfObject[7] = localTextCache.vs;
        arrayOfObject[8] = localTextCache.lvs;
        arrayOfObject[9] = ValuePool.getBoolean(localTextCache.ignoreFirst);
View Full Code Here

TOP

Related Classes of org.hsqldb.persist.TextCache

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.