ERRO
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
null
CODIGO ABAIXO alguém pode me ajudar?
/*
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
*/
package br.com.ldsistemas.dal;
import java.sql.*;
//@author Leocadio
public class ModuloConexao {
//Metodo responsavel por estabelecer a conexao com o banco de dadospublicstaticConnectionconector(){java.sql.Connectionconexao=null;// A linha abaixo chama o driver de conexao na bibliotecaStringdriver="com.mysql.cj.jdbc.Driver";// Armazenando informações referente ao banco de dadosStringurl="jdbc:mysql://localhost/ldsistemas?autoReconnect=true&useSSL=false";Stringuser="root";Stringpassword="";// Estabelecendo a conexão com o banco de dadostry{Class.forName(driver);conexao=DriverManager.getConnection(url,"root","");returnconexao;}catch(Exceptione){System.out.println(e);returnnull;}}publicstaticConnectionConector(){thrownewUnsupportedOperationException("Not supported yet.");//To change body of generated methods, choose Tools | Templates.}
@param args the command line arguments /
public static void main(String args[]) {
/ Set the Nimbus look and feel /
//
/ If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.