We use cookies. By browsing our site you agree to our use of cookies.

Accept this cookie

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/eldb/domains/eldb.eu/public_html/system/database/mysql.php on line 6
Mysql-connector-java-8.0.25.jar Download Apr 2026

// Note: Driver registration is automatic with JDBC 4+ try (Connection conn = DriverManager.getConnection(url, user, password)) System.out.println("Connected to MySQL successfully!"); catch (SQLException e) System.err.println("Connection failed: " + e.getMessage());

<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.25</version> </dependency> – Add to build.gradle :

import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class MySQLTest public static void main(String[] args) String url = "jdbc:mysql://localhost:3306/your_database"; String user = "your_username"; String password = "your_password";

– Add to pom.xml :