Package org.tmatesoft.sqljet.core.table

Examples of org.tmatesoft.sqljet.core.table.ISqlJetCursor.eof()


                Assert.assertTrue(cursor.getRowCount() == 3);
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.previous());
                // at 0.
                Assert.assertFalse(cursor.previous());
                Assert.assertTrue(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
               
                Assert.assertTrue(cursor.first());
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
View Full Code Here


                Assert.assertFalse(cursor.previous());
                Assert.assertTrue(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
               
                Assert.assertTrue(cursor.first());
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
                Assert.assertTrue(cursor.last());
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
               
View Full Code Here

               
                Assert.assertTrue(cursor.first());
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
                Assert.assertTrue(cursor.last());
                Assert.assertFalse(cursor.eof());
                Assert.assertTrue(cursor.getRowCount() == 3);
               
                cursor.close();
                return null;
            }
View Full Code Here

        db.runReadTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
                SqlJetScope scope = new SqlJetScope(new Object[] {1, 2}, true, new Object[] {1, 2}, true);
                ISqlJetCursor cursor = db.getTable("pairs").scope("pairs_idx", scope);
       
                Assert.assertTrue(!cursor.eof());
                Assert.assertTrue(cursor.next());
                Assert.assertTrue(cursor.next());
                Assert.assertEquals(cursor.getRowCount(), 4);
                Assert.assertTrue(cursor.next());
                Assert.assertFalse(cursor.eof());
View Full Code Here

                Assert.assertTrue(!cursor.eof());
                Assert.assertTrue(cursor.next());
                Assert.assertTrue(cursor.next());
                Assert.assertEquals(cursor.getRowCount(), 4);
                Assert.assertTrue(cursor.next());
                Assert.assertFalse(cursor.eof());
                Assert.assertFalse(cursor.next());
                Assert.assertTrue(cursor.eof());
               
                return null;
            }
View Full Code Here

                Assert.assertTrue(cursor.next());
                Assert.assertEquals(cursor.getRowCount(), 4);
                Assert.assertTrue(cursor.next());
                Assert.assertFalse(cursor.eof());
                Assert.assertFalse(cursor.next());
                Assert.assertTrue(cursor.eof());
               
                return null;
            }
        });
       
View Full Code Here

      table.insertOr(SqlJetConflictAction.REPLACE, 2, "test note", 1);

      db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
      try {
        ISqlJetCursor cursor = table.lookup(table.getPrimaryKeyIndexName(), 1);
        assertFalse(cursor.eof());
      } finally {
        db.commit();
      }

    }
View Full Code Here

        long start = System.currentTimeMillis();
        long end = start + _batch_millis;
        long now;
        ISqlJetCursor cursor = _table.open();
        try {
            boolean more = !cursor.eof();
            while ((now = System.currentTimeMillis()) < end && more) {
                n_read++;
                cursor.getInteger(0);
                more = cursor.next();
            }
View Full Code Here

            public Object run(SqlJetDb db) throws SqlJetException {
                List<Object> valuesInScope = new ArrayList<Object>()
                ISqlJetCursor scopeCursor = db.getTable(tableName).scope(indexName, scope);
                Assert.assertNotNull(scopeCursor);
                try {
                    while(!scopeCursor.eof()) {
                        if (scopeCursor.getFieldsCount() == 1 || !allFields) {
                            valuesInScope.add(scopeCursor.getValue(0));
                        } else {
                            Object[] values = new Object[scopeCursor.getFieldsCount()];
                            for (int i = 0; i < values.length; i++) {
View Full Code Here

         db.runTransaction(new ISqlJetTransaction() {
            public Object run(SqlJetDb db) throws SqlJetException {
              ISqlJetTable table = db.getTable("beans");
              ISqlJetCursor cur = table.lookup(table.getPrimaryKeyIndexName(),1);
              if (!cur.eof()) {
                long v = cur.getInteger(0);
                Assert.assertEquals(1, v);
                boolean isNull = cur.isNull(0); // -> returns true
                Assert.assertFalse(isNull);
              }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.