Package net.rim.device.api.database

Examples of net.rim.device.api.database.Statement.bind()


        try {
            // INSERT a row into the Category table for the new category
            Statement statement =
                    _db.createStatement("INSERT INTO Category VALUES(null, ?)");
            statement.prepare();
            statement.bind(1, name);
            statement.execute();
            statement.close();

            // Query the database for the auto-generated ID of the category just
            // added
View Full Code Here


            // added
            // and create a new Category object.
            statement =
                    _db.createStatement("SELECT category_id FROM Category WHERE category_name = ?");
            statement.prepare();
            statement.bind(1, name);
            final Cursor cursor = statement.getCursor();
            if (cursor.next()) {
                final Row row = cursor.getRow();
                final int id = row.getInteger(0);
                category = new Category(id, name);
View Full Code Here

        try {
            // Insert a new record in the DirectoryItems table
            final Statement statement =
                    _db.createStatement("INSERT INTO DirectoryItems VALUES(null, ?, ?, ?, ?)");
            statement.prepare();
            statement.bind(1, categoryID);
            statement.bind(2, name);
            statement.bind(3, location);
            statement.bind(4, phone);
            statement.execute();
            statement.close();
View Full Code Here

            // Insert a new record in the DirectoryItems table
            final Statement statement =
                    _db.createStatement("INSERT INTO DirectoryItems VALUES(null, ?, ?, ?, ?)");
            statement.prepare();
            statement.bind(1, categoryID);
            statement.bind(2, name);
            statement.bind(3, location);
            statement.bind(4, phone);
            statement.execute();
            statement.close();
View Full Code Here

            final Statement statement =
                    _db.createStatement("INSERT INTO DirectoryItems VALUES(null, ?, ?, ?, ?)");
            statement.prepare();
            statement.bind(1, categoryID);
            statement.bind(2, name);
            statement.bind(3, location);
            statement.bind(4, phone);
            statement.execute();
            statement.close();

            // Retrieve the auto-generated ID of the item just added
View Full Code Here

                    _db.createStatement("INSERT INTO DirectoryItems VALUES(null, ?, ?, ?, ?)");
            statement.prepare();
            statement.bind(1, categoryID);
            statement.bind(2, name);
            statement.bind(3, location);
            statement.bind(4, phone);
            statement.execute();
            statement.close();

            // Retrieve the auto-generated ID of the item just added
            id = _db.lastInsertedRowID();
View Full Code Here

        try {
            // Update the record in the DirectoryItems table for the given id
            final Statement statement =
                    _db.createStatement("UPDATE DirectoryItems SET item_name = ?, location = ?, phone = ? WHERE id = ?");
            statement.prepare();
            statement.bind(1, name);
            statement.bind(2, location);
            statement.bind(3, phone);
            statement.bind(4, id);
            statement.execute();
            statement.close();
View Full Code Here

            // Update the record in the DirectoryItems table for the given id
            final Statement statement =
                    _db.createStatement("UPDATE DirectoryItems SET item_name = ?, location = ?, phone = ? WHERE id = ?");
            statement.prepare();
            statement.bind(1, name);
            statement.bind(2, location);
            statement.bind(3, phone);
            statement.bind(4, id);
            statement.execute();
            statement.close();
        } catch (final DatabaseException dbe) {
View Full Code Here

            final Statement statement =
                    _db.createStatement("UPDATE DirectoryItems SET item_name = ?, location = ?, phone = ? WHERE id = ?");
            statement.prepare();
            statement.bind(1, name);
            statement.bind(2, location);
            statement.bind(3, phone);
            statement.bind(4, id);
            statement.execute();
            statement.close();
        } catch (final DatabaseException dbe) {
            SQLiteDemo.errorDialog(dbe.toString());
View Full Code Here

                    _db.createStatement("UPDATE DirectoryItems SET item_name = ?, location = ?, phone = ? WHERE id = ?");
            statement.prepare();
            statement.bind(1, name);
            statement.bind(2, location);
            statement.bind(3, phone);
            statement.bind(4, id);
            statement.execute();
            statement.close();
        } catch (final DatabaseException dbe) {
            SQLiteDemo.errorDialog(dbe.toString());
        }
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.