public abstract class Table extends Object
Modifier and Type | Field and Description |
---|---|
protected SQLDB |
db |
protected String |
tableName |
protected boolean |
usingMySQL |
Constructor and Description |
---|
Table(String name,
SQLDB db,
boolean usingMySQL)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addColumns(String... columnInfo) |
protected void |
close(AutoCloseable... toClose)
Closes DB elements.
|
protected void |
commit(Connection connection) |
abstract void |
createTable() |
protected void |
createTable(String sql) |
boolean |
equals(Object o) |
protected boolean |
execute(String statementString)
Executes an SQL Statement
|
protected void |
executeUnsafe(String... statements)
Used to execute queries while possible SQLExceptions are suppressed.
|
protected Connection |
getConnection()
Used to get a new Connection to the Database.
|
SQLDB |
getDb() |
String |
getTableName() |
int |
getVersion()
Get the Database Schema version from VersionTable.
|
int |
hashCode() |
void |
removeAllData()
Removes all data from the table.
|
protected void |
removeColumns(String... columnNames) |
String |
toString() |
protected final String tableName
protected final SQLDB db
protected final boolean usingMySQL
public abstract void createTable() throws DBCreateTableException
DBCreateTableException
protected void createTable(String sql) throws DBCreateTableException
DBCreateTableException
protected Connection getConnection() throws SQLException
SQLException
- DB Errorpublic int getVersion() throws SQLException
SQLException
- DB Errorprotected boolean execute(String statementString) throws SQLException
statementString
- Statement to executeSQLException
- DB errorprotected void executeUnsafe(String... statements)
statements
- SQL statements to executeprotected void close(AutoCloseable... toClose)
toClose
- All elements to close.public String getTableName()
public void removeAllData() throws SQLException
SQLException
protected void addColumns(String... columnInfo)
protected void removeColumns(String... columnNames)
protected void commit(Connection connection) throws SQLException
SQLException
public SQLDB getDb()
Copyright © 2017. All rights reserved.