com.intellectualcrafters.plot.database

## Class SQLite

- java.lang.Object
- - com.intellectualcrafters.plot.database.Database
  - - com.intellectualcrafters.plot.database.SQLite

-     public class SQLite
      extends Database

  Connects to and uses a SQLite database

- - ### Field Summary

    - ### Fields inherited from class com.intellectualcrafters.plot.database.Database

      `plugin`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SQLite(org.bukkit.plugin.Plugin plugin, java.lang.String dbLocation)` Creates a new SQLite instance

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkConnection()` Checks if a connection is open with the database
    `boolean` | `closeConnection()` Closes the connection with the database
    `java.sql.Connection` | `getConnection()` Gets the connection with the database
    `java.sql.Connection` | `openConnection()` Opens a connection with the database
    `java.sql.ResultSet` | `querySQL(java.lang.String query)` Executes a SQL Query If the connection is closed, it will be opened
    `int` | `updateSQL(java.lang.String query)` Executes an Update SQL Query See `Statement.executeUpdate(String)` If the connection is closed, it will be opened

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SQLite

          public SQLite(org.bukkit.plugin.Plugin plugin,
                java.lang.String dbLocation)

      Creates a new SQLite instance
      Parameters:
        `plugin` - Plugin instance
        `dbLocation` - Location of the Database (Must end in .db)

  - ### Method Detail

    - #### openConnection

          public java.sql.Connection openConnection()
                                             throws java.sql.SQLException,
                                                    java.lang.ClassNotFoundException

      Description copied from class: `Database`
      Opens a connection with the database
      Specified by:
        `openConnection` in class `Database`
      Returns:
        Opened connection
      Throws:
        `java.sql.SQLException` - if the connection can not be opened
        `java.lang.ClassNotFoundException` - if the driver cannot be found

    - #### checkConnection

          public boolean checkConnection()
                                  throws java.sql.SQLException

      Description copied from class: `Database`
      Checks if a connection is open with the database
      Specified by:
        `checkConnection` in class `Database`
      Returns:
        true if the connection is open
      Throws:
        `java.sql.SQLException` - if the connection cannot be checked

    - #### getConnection

          public java.sql.Connection getConnection()

      Description copied from class: `Database`
      Gets the connection with the database
      Specified by:
        `getConnection` in class `Database`
      Returns:
        Connection with the database, null if none

    - #### closeConnection

          public boolean closeConnection()
                                  throws java.sql.SQLException

      Description copied from class: `Database`
      Closes the connection with the database
      Specified by:
        `closeConnection` in class `Database`
      Returns:
        true if successful
      Throws:
        `java.sql.SQLException` - if the connection cannot be closed

    - #### querySQL

          public java.sql.ResultSet querySQL(java.lang.String query)
                                      throws java.sql.SQLException,
                                             java.lang.ClassNotFoundException

      Description copied from class: `Database`
      Executes a SQL Query
      If the connection is closed, it will be opened
      Specified by:
        `querySQL` in class `Database`
      Parameters:
        `query` - Query to be run
      Returns:
        the results of the query
      Throws:
        `java.sql.SQLException` - If the query cannot be executed
        `java.lang.ClassNotFoundException` - If the driver cannot be found; see `Database.openConnection()`

    - #### updateSQL

          public int updateSQL(java.lang.String query)
                        throws java.sql.SQLException,
                               java.lang.ClassNotFoundException

      Description copied from class: `Database`
      Executes an Update SQL Query
      See `Statement.executeUpdate(String)`
      If the connection is closed, it will be opened
      Specified by:
        `updateSQL` in class `Database`
      Parameters:
        `query` - Query to be run
      Returns:
        Result Code, see `Statement.executeUpdate(String)`
      Throws:
        `java.sql.SQLException` - If the query cannot be executed
        `java.lang.ClassNotFoundException` - If the driver cannot be found; see `Database.openConnection()`