Not connected connection = getConnection(URL, USERNAME, PASSWORD);. How to connect a database to the environment?

Mounts the database. If you zakamentuj line connection = getConnection(URL, USERNAME, PASSWORD);, everything works. Can't understand what the error is.
PS pattern as it was fucking darkness of errors, working with multiple directories, but the fix does not work

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""


 <!-- -->



import com.mysql.fabric.jdbc.FabricMySQLDriver;

import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;

import static java.sql.DriverManager.getConnection;

public class Main {

 public static final String URL = "jdbc:mysql://localhost:3306/test";
 public static final String USERNAME = "root";
 public static final String PASSWORD = "0000";

 public static void main(String[] args){

 Connection connection;

 try { //connect to the MySQL driver
 Driver Driver;
 driver = new FabricMySQLDriver();


 connection = getConnection(URL, USERNAME, PASSWORD);
 System.out.println("DriverManager FabricMySQLDriver and work! ");

 } catch (SQLException e) {
 System.out.println("failed to load FabricMySQLDriver ");
April 4th 20 at 13:04
2 answers
April 4th 20 at 13:06
If you remove the line, you will get the message, but not the fact of the konekta. And errors what?
April 4th 20 at 13:08
System.out.println("failed to load FabricMySQLDriver ");

need to replace
throw new RuntimeException("failed to load FabricMySQLDriver ", e);

Then it will become clear why the connection failed, and it will be possible for the forum to write.
The list of possible problems is non-existent database, invalid login/password, not running the DBMS server.

Find more questions by tags MySQLJavaApache MavenJDBC