Gracias @Xerelo ...
como MySQL es de Oracle... eso me causo confusion
Lo arreglé en 1 minuto:
Código Java:
Ver originalimport java.sql.*;
class JdbcDriverManagerRegisterDriver
{
public static void main
(String args
[]) {
// Load the MySQL JDBC driver
String dbDriver
= "com.mysql.jdbc.Driver"; String dbURL
= "jdbc:mysql://localhost/";
System.
out.
print("Connecting to the database...");
System.
out.
println("Connecting..."); (dbURL + dbDBase +
"?user=" + dbUser +
"&password=" + dbPasswd);
System.
out.
println("connected.");
// Create a statement
// Do the SQL "Hello World" thing
ResultSet rset
= stmt.
executeQuery("select 'Hello World' from dual");
while (rset.next())
System.
out.
println(rset.
getString(1)); // close the result set, the statement and connect
rset.close();
stmt.close();
conn.close();
System.
out.
println("Your JDBC installation is correct."); }
}
Las fallas obviamente estaban en referenciar los drivers de ORACLE:
Cita: DriverManager.registerDriver(new com.mysql.jdbc.Driver());
...
...
Connection conn = DriverManager.getConnection
(dbURL + dbDBase +
"?user=" + dbUser +
"&password=" + dbPasswd);