public abstract class TacoDatabase
extends java.lang.Object
pluginname:
mysql:
server:
address:
port
database:
name:
username:
password:
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
address |
private java.sql.Connection |
conn |
private java.lang.String |
db |
private java.lang.String |
pass |
private int |
port |
private java.lang.String |
usr |
| Constructor and Description |
|---|
TacoDatabase(TacoConfig config) |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkConnection()
Checks if the connection to the MySQL server is valid.
|
private void |
connect()
Establishes a connection with the MySQL server.
|
protected abstract void |
createTables()
This method is used to create the MySQL needed for the plugin.
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Sends a query to the MySQL server and receives a
ResultSet |
int |
getRowCount(java.sql.ResultSet rs)
Gets the row count of a
ResultSet |
void |
sendQuery(java.lang.String sql)
Sends a query to the MySQL server
|
private java.sql.Connection conn
private java.lang.String address
private java.lang.String db
private java.lang.String usr
private java.lang.String pass
private int port
public TacoDatabase(TacoConfig config) throws java.lang.Exception
java.lang.Exceptionprotected abstract void createTables()
private void connect()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void checkConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getRowCount(java.sql.ResultSet rs)
ResultSetrs - - The ResultSet from which to count the rowspublic void sendQuery(java.lang.String sql)
throws java.sql.SQLException
sql - - The query to sendjava.sql.SQLExceptionpublic java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
ResultSetsql - - The query to sendjava.sql.SQLException