Estou estudando conexão no banco de dados e peguei a apostila da caelum quando fui execultar deu um ERRO alguém poderia me ajudar
Classe de conexão
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class AluraConexão {
private Connection con = null;
private Statement statement = null ;
private ResultSet resultset = null;
public Connection getConnection() {
try {
return DriverManager.getConnection(
"jdbc:mysql:3306//localhost/teste", "root", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
ERRO que foi dado
Exception in thread “main” java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:mysql:3306//localhost/teste
at br.edu.fbv.conexao.AluraConexão.getConnection(AluraConexão.java:21)
at br.edu.fbv.conexao.Teste12.main(Teste12.java:7)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql:3306//localhost/teste
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at br.edu.fbv.conexao.AluraConexão.getConnection(AluraConexão.java:18)
… 1 more