Class MySQLDB

  • All Implemented Interfaces:
    Database

    @Singleton
    public class MySQLDB
    extends SQLDB
    • Field Detail

      • dataSource

        protected com.zaxxer.hikari.HikariDataSource dataSource
    • Constructor Detail

      • MySQLDB

        @Inject
        public MySQLDB​(Locale locale,
                       PlanConfig config,
                       dagger.Lazy<ServerInfo> serverInfo,
                       net.playeranalytics.plugin.scheduling.RunnableFactory runnableFactory,
                       net.playeranalytics.plugin.server.PluginLogger pluginLogger,
                       ErrorLogger errorLogger)
    • Method Detail

      • getType

        public DBType getType()
        Description copied from interface: Database
        Used to get the DBType of the Database
        Returns:
        the DBType
        See Also:
        DBType
      • setupDataSource

        public void setupDataSource()
        Setups the HikariDataSource
        Specified by:
        setupDataSource in class SQLDB
      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.SQLException
        Specified by:
        getConnection in class SQLDB
        Throws:
        java.sql.SQLException
      • returnToPool

        public void returnToPool​(java.sql.Connection connection)
        Specified by:
        returnToPool in class SQLDB
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class SQLDB
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class SQLDB