Package org.tmatesoft.sqljet.core.table

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


      try {
        table = podsalinanDB.getTable("podcasts");
        podsalinanDB.beginTransaction(SqlJetTransactionMode.READ_ONLY);
        if (table!=null){
          ISqlJetCursor currentDBLine = table.order(table.getPrimaryKeyIndexName());
          if (!currentDBLine.eof()){
            do {
              Podcast newPodcast = new Podcast(currentDBLine.getString("name"),
                               currentDBLine.getString("url"),
                               currentDBLine.getString("directory"),
                               currentDBLine.getString("localFile").replaceAll("'", "\'"),
View Full Code Here


    private boolean isAnswered(int number) throws SqlJetException {
        db.beginTransaction(SqlJetTransactionMode.READ_ONLY);
        try {
            ISqlJetTable table = db.getTable("answers");
            ISqlJetCursor cursor = table.lookup("login_question", login.getLogin(), number);
            return !cursor.eof();
        } finally {
            db.commit();
        }
    }
View Full Code Here

        db.beginTransaction(SqlJetTransactionMode.WRITE);
        ISqlJetTable table = db.getTable("answers");
        final ISqlJetCursor cursor = table.lookup("login", login.getLogin());
        int answered = (int) cursor.getRowCount();
        int right = 0;
        if (!cursor.eof()) {
            do {
                if (Integer.parseInt(cursor.getString("answer")) == 1) ++right;
            } while (cursor.next());
        }
        cursor.close();
View Full Code Here

    private boolean tryLogin(String login, String password) throws SqlJetException {
        db.beginTransaction(SqlJetTransactionMode.WRITE);
        try {
            ISqlJetTable table = db.getTable("users");
            ISqlJetCursor cursor = table.lookup("login_password", login, password);
            return !cursor.eof();
        } finally {
            db.commit();
        }
    }
View Full Code Here

                    return i == 0 ? "Number of question" : "Result";
                }

                public void makeMas() throws SqlJetException {
                    int i = 0;
                    if (!cursor.eof()) {
                        do {
                            mas[i][0] = cursor.getString("question");
                            mas[i][1] = cursor.getString("answer").equals("1") ? "Correct" : "Incorrect";
                            i++;
                        } while (cursor.next());
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.