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, waitbatchUpdate, commit, isAutoCommit, operate, prepare, query, query, rollback, setAutoCommit, updateprotected 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 useConnectionSQLException - 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 fileConnectionSQLException - 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 fileConnectionSQLException - 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 locationConnectionSQLException - If the connection fails to openpublic boolean checkTable(String tableName)
checkTable in interface SQLDataTypetableName - Name of the table to check forpublic boolean checkColumn(String tableName, String columnName)
checkColumn in interface SQLDataTypetableName - The table to look incolumnName - The column to search fortrue if the column existspublic void setErrorOutput(boolean errors)
SQLDataTypetruesetErrorOutput in interface SQLDataTypeerrors - false to disable error outputpublic boolean isSendingErrorOutput()
SQLDataTypeisSendingErrorOutput in interface SQLDataTypetrue if content is printed to the console.public void close()
close in interface SQLDataTypeclose in interface AutoCloseablepublic Connection getConnection()
Connection object for ease of use in exposing more
internal APIgetConnection in interface SQLDataTypeConnection object in use by this SQLDataTypeCopyright © 2015. All rights reserved.