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.String
getTableName()
Get table nameabstract java.util.ArrayList<java.lang.String>
getTables()
java.lang.String
getURL()
abstract java.sql.Connection
openConnect()
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 pluginvoid
setURL(java.lang.String url)
int
size()
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:
getURL
in 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:
openConnect
in interfaceOptEcoEstablish
- Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
-
getTables
public abstract java.util.ArrayList<java.lang.String> getTables()- Specified by:
getTables
in interfaceOptEcoEstablish
-
getTableName
public java.lang.String getTableName()Get table name- Specified by:
getTableName
in 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
-