Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import com.mysql.fabric.jdbc.FabricMySQLDriver;
- import java.sql.*;
- public class Main {
- private static final String URL = "jdbc:mysql://localhost:3306/mydb_test";
- private static final String USERNAME = "root";
- private static final String PASSWORD = "root";
- public static void main(String[] args){
- try {
- Driver driver = new FabricMySQLDriver();
- DriverManager.registerDriver(driver);
- }
- catch (SQLException e) {
- e.printStackTrace();
- }
- try(Connection connection = DriverManager.getConnection(URL, USERNAME, PASSWORD); Statement statement = connection.createStatement() ) {
- System.out.println(connection.isClosed());
- }
- catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment