Package me.playernguyen.opteco.sql
Class SQLEstablish
java.lang.Object
me.playernguyen.opteco.OptEcoImplementation
me.playernguyen.opteco.sql.SQLEstablish
- All Implemented Interfaces:
OptEcoEstablish
- Direct Known Subclasses:
MySQLEstablish,SQLiteEstablish
public abstract class SQLEstablish extends OptEcoImplementation implements OptEcoEstablish
-
Constructor Summary
Constructors Constructor Description SQLEstablish(java.lang.String tableName, java.util.ArrayList<java.lang.String> initialDataList) -
Method Summary
Modifier and Type Method Description java.lang.StringgetTableName()Get table nameabstract java.util.ArrayList<java.lang.String>getTables()java.lang.StringgetURL()abstract java.sql.ConnectionopenConnect()voidsetupTable()Setup the table manually by condition
If table are set, log skip create If table created, log created If table failed to set, log error and disabling pluginvoidsetURL(java.lang.String url)intsize()Get size of table (rows)Methods inherited from class me.playernguyen.opteco.OptEcoImplementation
getAccountDatabase, getAccountManager, getConfigurationLoader, getDebugger, getLanguageLoader, getLogger, getPlugin, getStorageType, getTransactionManager
-
Constructor Details
-
SQLEstablish
public SQLEstablish(java.lang.String tableName, java.util.ArrayList<java.lang.String> initialDataList)
-
-
Method Details
-
getURL
@Nullable public java.lang.String getURL()- Specified by:
getURLin interfaceOptEcoEstablish
-
setURL
public void setURL(java.lang.String url) -
openConnect
public abstract java.sql.Connection openConnect() throws java.sql.SQLException, java.lang.ClassNotFoundException- Specified by:
openConnectin interfaceOptEcoEstablish- Throws:
java.sql.SQLExceptionjava.lang.ClassNotFoundException
-
getTables
public abstract java.util.ArrayList<java.lang.String> getTables()- Specified by:
getTablesin interfaceOptEcoEstablish
-
getTableName
public java.lang.String getTableName()Get table name- Specified by:
getTableNamein interfaceOptEcoEstablish- Returns:
CreateTableState
-
setupTable
public void setupTable()Setup the table manually by condition
- If table are set, log skip create
- If table created, log created
- If table failed to set, log error and disabling plugin
-
size
public int size()Get size of table (rows)- Returns:
- The size of query or -1 if the caught the exception
-