Перейти к содержимому
Mineforgian

JSMySQLFix

JSMySQLFix is an innovative plugin designed for the Velocity proxy environment that ensures seamless MySQL database connectivity by automatically downloading and embedding the MySQL JDBC drivers.

Загрузки
551
Подписчики
5
Обновлён
15 мая 2025 г.
Лицензия
MIT

Опубликован 8 октября 2024 г.

JSMySQLFix

Join my Discord

Description: JSMySQLFix is an innovative plugin designed for the Velocity proxy environment that ensures seamless MySQL database connectivity by automatically downloading and embedding the MySQL JDBC drivers. This plugin aims to simplify dependencies for server administrators and address potential issues caused by missing or incorrect drivers.

Features:

  • Automatic Download: The plugin checks if the required MySQL JDBC driver is present. If not, it automatically downloads the driver from a secure source and saves it in the data directory.
  • SHA-256 Verification: After the download, a SHA-256 verification is performed to ensure the integrity of the downloaded file, ensuring that the driver is unchanged and secure.
  • Easy Embedding: Upon successful download, the MySQL driver is directly embedded into the application's classpath, allowing immediate use of MySQL functions.
  • Logging: To facilitate maintenance, the plugin offers comprehensive logging capabilities that detail both successful downloads and any potential errors.

Accessing MySQL: Once the JSMySQLFix plugin is installed and the MySQL driver is successfully embedded, other plugins can access MySQL instantly. Developers can utilize standard JDBC connections to interact with their MySQL databases using the following connection string format:

    String ip = "yourIP";
    String port = "3306";
    String databaseName = "yourDatabase";
    String url = "jdbc:mysql://" + ip + ":" + port + "/" + databaseName + "?useSSL=false&allowPublicKeyRetrieval=true";
    String username = "yourUsername";
    String password = "yourPassword";

    try {
        Class.forName("com.mysql.cj.jdbc.Driver");
        logger.info("Attempting to connect to database.);

        connection = DriverManager.getConnection(url, username, password);
        logger.info("Connected to the database.");
    } catch (ClassNotFoundException e) {
        logger.error("MySQL Driver not found: " + e.getMessage());
    } catch (SQLException e) {
        logger.error("Error while connecting to the database: " + e.getMessage());
    }

Ensure to replace <yourIP>, <port>, <yourDatabase>, <yourUsername>, and <yourPassword> with your actual MySQL server details.

Installation:

  1. Download the plugin and place it in the /plugins directory of your Velocity proxy.
  2. Restart the proxy. The plugin will automatically download and embed the necessary MySQL drivers.
  3. Check the logs to confirm that everything has been installed correctly.

Ченджлог

1.0.1Релиз26.1, 26.1.1, 26.1.2 · 15 мая 2025 г.

🛠 Version 1.0.1 – "Loaded First, Serves All"

Released on: 15.05.2025

✨ Changes

The plugin is now configured to load before any other plugin, including critical ones like LuckPerms.

This ensures the MySQL JDBC driver is available before any plugin attempts to establish a database connection.

Adjusted internal plugin ID (aa_jsmysqlfix) to enforce priority loading order during server startup.

🐛 Fixes

Improved handling of .downloading files to avoid corruption during interrupted downloads.

More robust SHA-256 checksum verification for downloaded drivers, enhancing security.

📌 Note

This update is primarily intended for users who experienced issues with plugins relying on MySQL being initialized before the driver was available.

Комментарии

Загружаем…