Não estou conseguindo conectar com o MySql usando o Eclipse, configurei o driver deu ping tudo certinho porem deu erro, vai abaixo o que estou fazendo e o erro que aparece, se puder me ajudar sou muito grato.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class teste {
public static void main(String [] args) {
try {
Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost/otica?" +
"user=root&password=1234");
// Do something with the Connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}
}
}
ERRO :
SQLException: No suitable driver found for jdbc:mysql://localhost/otica?user=root&password=1234
SQLState: 08001
VendorError: 0