Package org.tmatesoft.sqljet.core.table

Examples of org.tmatesoft.sqljet.core.table.ISqlJetTable


            public Object run(SqlJetDb db) throws SqlJetException {
                final ISqlJetTableDef createTable = db
                        .createTable("create table test( id integer primary key, name text )");
                logger.info(createTable.toString());
                db.createIndex("CREATE INDEX test_index ON test(name);");
                final ISqlJetTable openTable = createDb.getTable(createTable.getName());
                openTable.insert(null, "test");
                openTable.insert(null, "test1");
                try {
                    openTable.insert(null, new String(TEST_UTF8, "UTF8"));
                } catch (UnsupportedEncodingException e) {
                    throw new SqlJetException(e);
                }
                return null;
            }
View Full Code Here


            public Object run(SqlJetDb db) throws SqlJetException {
                final ISqlJetTableDef createTable = db
                        .createTable("create table test( id integer primary key, name text )");
                logger.info(createTable.toString());
                db.createIndex("CREATE INDEX test_index ON test(name);");
                final ISqlJetTable openTable = createDb.getTable(createTable.getName());
                openTable.insert(null, "test");
                openTable.insert(null, "test1");
                try {
                    openTable.insert(null, new String(TEST_UTF8, "UTF8"));
                } catch (UnsupportedEncodingException e) {
                    throw new SqlJetException(e);
                }
                createDb.getOptions().setEncoding(SqlJetEncoding.UTF16LE);
                return null;
View Full Code Here

                createDb.getOptions().setCacheSize(1000);
                final ISqlJetTableDef createTable = db
                        .createTable("create table test( id integer primary key, name text )");
                logger.info(createTable.toString());
                db.createIndex("CREATE INDEX test_index ON test(name);");
                final ISqlJetTable openTable = createDb.getTable(createTable.getName());
                openTable.insert(null, "test");
                openTable.insert(null, "test1");
                try {
                    openTable.insert(null, new String(TEST_UTF8, "UTF8"));
                } catch (UnsupportedEncodingException e) {
                    throw new SqlJetException(e);
                }
                return null;
            }
View Full Code Here

                final ISqlJetTableDef createTable = db
                        .createTable("create table test( id integer primary key, name text )");
                logger.info(createTable.toString());
                db.createIndex("CREATE INDEX test_index ON test(name);");
                final ISqlJetTable openTable = createDb.getTable(createTable.getName());
                openTable.insert(null, "test");
                openTable.insert(null, "test1");
                try {
                    openTable.insert(null, new String(TEST_UTF8, "UTF8"));
                } catch (UnsupportedEncodingException e) {
                    throw new SqlJetException(e);
                }
                return null;
            }
View Full Code Here

        });
        db.close();
        db.open();
        db.runWriteTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
                final ISqlJetTable openTable = db.getTable("test");
                openTable.insert(null, "test");
                openTable.insert(null, "test");
                return null;
            }
        });
        Assert.assertFalse(false);
    }
View Full Code Here

    Transaction transaction = new Transaction()
    {
      @Override
      public void execute(SqlJetDb db) throws SqlJetException
      {
        ISqlJetTable table = db.getTable(STATE_TABLE);
        ISqlJetCursor cursor = table.lookup(table.getPrimaryKeyIndexName(), event.getSource());
        try
        {
          if (!cursor.eof())
          {
            cursor.delete();
View Full Code Here

    {
      @Override
      public Set<String> execute(SqlJetDb database) throws SqlJetException
      {
        Set<String> set = new TreeSet<String>();
        ISqlJetTable table = database.getTable(STATE_TABLE);
        ISqlJetCursor cursor = table.lookup(table.getPrimaryKeyIndexName());
        try
        {
          if (!cursor.eof())
          {
            do
View Full Code Here

    Transaction transaction = new Transaction()
    {
      @Override
      public void execute(SqlJetDb db) throws SqlJetException
      {
        ISqlJetTable table = db.getTable(STATE_TABLE);
        table.clear();
        for (String database: databases)
        {
          table.insert(database);
        }
      }
    };
    try
    {
View Full Code Here

    Transaction transaction = new Transaction()
    {
      @Override
      public void execute(SqlJetDb db) throws SqlJetException
      {
        ISqlJetTable table = db.getTable(INVOCATION_TABLE);
        ISqlJetCursor cursor = table.lookup(table.getPrimaryKeyIndexName(), transactionId, phase);
        try
        {
          if (!cursor.eof())
          {
            cursor.delete();
          }
        }
        finally
        {
          close(cursor);
        }
        table = db.getTable(INVOKER_TABLE);
        cursor = table.lookup(INVOKER_TABLE_INDEX, transactionId, phase);
        try
        {
          if (!cursor.eof())
          {
            do
View Full Code Here

    Transaction transaction = new Transaction()
    {
      @Override
      public void execute(SqlJetDb db) throws SqlJetException
      {
        ISqlJetTable table = db.getTable(INVOKER_TABLE);
        ISqlJetCursor cursor = table.lookup(table.getPrimaryKeyIndexName(), transactionId, phase, databaseId);
        try
        {
          if (!cursor.eof())
          {
            cursor.updateByFieldNames(Collections.<String, Object>singletonMap(RESULT_COLUMN, result));
View Full Code Here

TOP

Related Classes of org.tmatesoft.sqljet.core.table.ISqlJetTable

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.