Package org.tmatesoft.sqljet.core.table

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


        }
    }

    private String printShortSummary() throws SqlJetException {
        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;
View Full Code Here


    }

    public void answer(int question, int ansNum) throws SqlJetException {
        db.beginTransaction(SqlJetTransactionMode.WRITE);
        try {
            ISqlJetTable table = db.getTable("answers");
            table.insert(login.getLogin(), question, ansNum);
        } finally {
            db.commit();
        }
    }
View Full Code Here

    }

    private void register(String login, String password) throws SqlJetException {
        db.beginTransaction(SqlJetTransactionMode.WRITE);
        try {
            ISqlJetTable table = db.getTable("users");
            table.insert(login, password);
        } finally {
            db.commit();
        }
    }
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

    }

    private void printResults() throws SqlJetException {
        db.beginTransaction(SqlJetTransactionMode.WRITE);
        try {
            ISqlJetTable table = db.getTable("answers");
            final ISqlJetCursor cursor = table.lookup("login", login.getLogin());
            TableModel dataModel = new AbstractTableModel() {
                String[][] mas = new String[(int) cursor.getRowCount()][2];

                {
                    makeMas();
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.