Class CoreStatement

    • Method Detail

      • getDatabase

        public DB getDatabase()
      • checkOpen

        protected final void checkOpen()
                                throws SQLException
        Throws:
        SQLException - If the database is not opened.
      • exec

        protected boolean exec()
                        throws SQLException
        Calls sqlite3_step() and sets up results. Expects a clean stmt.
        Returns:
        True if the ResultSet has at least one row; false otherwise.
        Throws:
        SQLException - If the given SQL statement is null or no database is open.
      • exec

        protected boolean exec​(String sql)
                        throws SQLException
        Executes SQL statement and throws SQLExceptions if the given SQL statement is null or no database is open.
        Parameters:
        sql - SQL statement.
        Returns:
        True if the ResultSet has at least one row; false otherwise.
        Throws:
        SQLException - If the given SQL statement is null or no database is open.
      • notifyFirstStatementExecuted

        protected void notifyFirstStatementExecuted()
      • updateGeneratedKeys

        public void updateGeneratedKeys()
                                 throws SQLException
        SQLite's last_insert_rowid() function is DB-specific. However, in this implementation we ensure the Generated Key result set is statement-specific by executing the query immediately after an insert operation is performed. The caller is simply responsible for calling updateGeneratedKeys on the statement object right after execute in a synchronized(connection) block.
        Throws:
        SQLException