public class SQLite extends Object implements SQLDataType
Modifier and Type | Field and Description |
---|---|
protected Connection |
con
The
Connection object |
protected static byte |
connections
The number of connections in use by this data type
|
Constructor and Description |
---|
SQLite() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkColumn(String tableName,
String columnName)
Checks if a table has the following column
|
boolean |
checkTable(String tableName)
Checks if a table exists within the set database
|
void |
close()
Closes the SQLite connection.
|
Connection |
getConnection()
Returns the
Connection object for ease of use in exposing more
internal API |
boolean |
isSendingErrorOutput()
Determines whether or not to automatically print errors to the console
|
Connection |
open(File database)
Opens a connection to the SQLite database.
|
Connection |
open(File folder,
String name)
Opens a connection to the SQLite database.
|
Connection |
open(Plugin plugin)
Opens a connection to the SQLite database.
|
Connection |
open(Plugin plugin,
String name)
Opens a connection to the SQLite database.
|
void |
setErrorOutput(boolean errors)
Sets whether or not to print errors to the console automatically.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
batchUpdate, commit, isAutoCommit, operate, prepare, query, query, rollback, setAutoCommit, update
protected static byte connections
protected Connection con
Connection
objectpublic Connection open(Plugin plugin) throws SQLException
close()
after you are finished working with the database
for your segment of your code.plugin
- The Plugin
with the data folder to useConnection
SQLException
- If the connection fails to openpublic Connection open(Plugin plugin, String name) throws SQLException
close()
after you are finished working with the database
for your segment of your code.plugin
- The Plugin
with the data folder to usename
- The name of the database fileConnection
SQLException
- If the connection fails to openpublic Connection open(File folder, String name) throws SQLException
close()
after you are finished working with the database
for your segment of your code.folder
- A File
pointing to a data folder for the databasename
- The name of the database fileConnection
SQLException
- If the connection fails to openpublic Connection open(File database) throws SQLException
close()
after you are finished working with the database
for your segment of your code.database
- A File
that represents the database locationConnection
SQLException
- If the connection fails to openpublic boolean checkTable(String tableName)
checkTable
in interface SQLDataType
tableName
- Name of the table to check forpublic boolean checkColumn(String tableName, String columnName)
checkColumn
in interface SQLDataType
tableName
- The table to look incolumnName
- The column to search fortrue
if the column existspublic void setErrorOutput(boolean errors)
SQLDataType
true
setErrorOutput
in interface SQLDataType
errors
- false
to disable error outputpublic boolean isSendingErrorOutput()
SQLDataType
isSendingErrorOutput
in interface SQLDataType
true
if content is printed to the console.public void close()
close
in interface SQLDataType
close
in interface AutoCloseable
public Connection getConnection()
Connection
object for ease of use in exposing more
internal APIgetConnection
in interface SQLDataType
Connection
object in use by this SQLDataType
Copyright © 2015. All rights reserved.