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 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 interface OptEcoEstablish
    • 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 interface OptEcoEstablish
      Throws:
      java.sql.SQLException
      java.lang.ClassNotFoundException
    • getTables

      public abstract java.util.ArrayList<java.lang.String> getTables()
      Specified by:
      getTables in interface OptEcoEstablish
    • getTableName

      public java.lang.String getTableName()
      Get table name
      Specified by:
      getTableName in interface OptEcoEstablish
      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