Class MySQL

java.lang.Object
com.github.pinont.singularitylib.api.utils.MySQL

public class MySQL extends Object
Utility class for managing MySQL database connections. Provides functionality to connect to MySQL databases with automatic configuration setup.
  • Constructor Details

    • MySQL

      public MySQL(org.bukkit.plugin.Plugin plugin)
      Default constructor for MySQL utility class.
  • Method Details

    • getConnection

      public Connection getConnection()
      Gets a connection to the database using the default config file.
      Returns:
      the database connection, or null if connection failed
    • getConnection

      public Connection getConnection(String configPath)
      Gets a connection to the database using the specified config file.
      Parameters:
      configPath - the path to the configuration file
      Returns:
      the database connection, or null if connection failed
    • init

      public void init(String configPath)
      Initializes the database connection using the specified config file.
      Parameters:
      configPath - the path to the configuration file
    • closeConnection

      public void closeConnection()
      Closes the database connection if it exists.