Class SQLiteConnection

  • All Implemented Interfaces:
    Connection

    public class SQLiteConnection
    extends java.lang.Object
    implements Connection
    • Constructor Detail

      • SQLiteConnection

        public SQLiteConnection​(java.lang.String url,
                                java.lang.String fileName)
                         throws java.sql.SQLException
        Constructor to create a connection to a database at the given location.
        Parameters:
        url - The location of the database.
        fileName - The database.
        Throws:
        java.sql.SQLException
      • SQLiteConnection

        public SQLiteConnection​(java.lang.String url,
                                java.lang.String fileName,
                                Hashtable prop)
                         throws java.sql.SQLException
        Constructor to create a pre-configured connection to a database at the given location.
        Parameters:
        url - The location of the database file.
        fileName - The database.
        prop - The configurations to apply.
        Throws:
        java.sql.SQLException
    • Method Detail

      • setBusyTimeout

        public void setBusyTimeout​(int milliseconds)
                            throws java.sql.SQLException
        Sets the timeout value for the connection. A timeout value less than or equal to zero turns off all busy handlers.
        Parameters:
        milliseconds - The timeout value in milliseconds.
        Throws:
        java.sql.SQLException
        See Also:
        http://www.sqlite.org/c3ref/busy_timeout.html
      • finalize

        public void finalize()
                      throws java.sql.SQLException
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.sql.SQLException
        See Also:
        Object.finalize()
      • close

        public void close()
                   throws java.sql.SQLException
        Specified by:
        close in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.close()
      • isClosed

        public boolean isClosed()
                         throws java.sql.SQLException
        Specified by:
        isClosed in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.isClosed()
      • getCatalog

        public java.lang.String getCatalog()
                                    throws java.sql.SQLException
        Specified by:
        getCatalog in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getCatalog()
      • setCatalog

        public void setCatalog​(java.lang.String catalog)
                        throws java.sql.SQLException
        Specified by:
        setCatalog in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setCatalog(java.lang.String)
      • getHoldability

        public int getHoldability()
                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getHoldability()
      • setHoldability

        public void setHoldability​(int h)
                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setHoldability(int)
      • getTransactionIsolation

        public int getTransactionIsolation()
        Specified by:
        getTransactionIsolation in interface Connection
        See Also:
        Connection.getTransactionIsolation()
      • setTransactionIsolation

        public void setTransactionIsolation​(int level)
                                     throws java.sql.SQLException
        Specified by:
        setTransactionIsolation in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setTransactionIsolation(int)
      • getTypeMap

        public Hashtable getTypeMap()
                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getTypeMap()
      • setTypeMap

        public void setTypeMap​(Hashtable map)
                        throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setTypeMap(java.util.Map)
      • isReadOnly

        public boolean isReadOnly()
                           throws java.sql.SQLException
        Specified by:
        isReadOnly in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.isReadOnly()
      • setReadOnly

        public void setReadOnly​(boolean ro)
                         throws java.sql.SQLException
        Specified by:
        setReadOnly in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setReadOnly(boolean)
      • getMetaData

        public DatabaseMetaData getMetaData()
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getMetaData()
      • nativeSQL

        public java.lang.String nativeSQL​(java.lang.String sql)
        Specified by:
        nativeSQL in interface Connection
        See Also:
        Connection.nativeSQL(java.lang.String)
      • clearWarnings

        public void clearWarnings()
                           throws java.sql.SQLException
        Specified by:
        clearWarnings in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.clearWarnings()
      • getWarnings

        public java.sql.SQLWarning getWarnings()
                                        throws java.sql.SQLException
        Specified by:
        getWarnings in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getWarnings()
      • getAutoCommit

        public boolean getAutoCommit()
                              throws java.sql.SQLException
        Specified by:
        getAutoCommit in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.getAutoCommit()
      • setAutoCommit

        public void setAutoCommit​(boolean ac)
                           throws java.sql.SQLException
        Specified by:
        setAutoCommit in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.setAutoCommit(boolean)
      • commit

        public void commit()
                    throws java.sql.SQLException
        Specified by:
        commit in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.commit()
      • rollback

        public void rollback()
                      throws java.sql.SQLException
        Specified by:
        rollback in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.rollback()
      • createStatement

        public Statement createStatement()
                                  throws java.sql.SQLException
        Specified by:
        createStatement in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.createStatement()
      • createStatement

        public Statement createStatement​(int rsType,
                                         int rsConcurr)
                                  throws java.sql.SQLException
        Specified by:
        createStatement in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.createStatement(int, int)
      • createStatement

        public Statement createStatement​(int rst,
                                         int rsc,
                                         int rsh)
                                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.createStatement(int, int, int)
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql)
                                           throws java.sql.SQLException
        Specified by:
        prepareStatement in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String)
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql,
                                                  int autoC)
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String, int)
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql,
                                                  int[] colInds)
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String, int[])
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql,
                                                  java.lang.String[] colNames)
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String, java.lang.String[])
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql,
                                                  int rst,
                                                  int rsc)
                                           throws java.sql.SQLException
        Specified by:
        prepareStatement in interface Connection
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String, int, int)
      • prepareStatement

        public PreparedStatement prepareStatement​(java.lang.String sql,
                                                  int rst,
                                                  int rsc,
                                                  int rsh)
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
        See Also:
        Connection.prepareStatement(java.lang.String, int, int, int)