S
SirWayne
Gast
was ist daran falsch????
Konsolen ausgabe
* Treiber laden
* Verbindung aufbauen
SQLException: No suitable driver found for jdbc:mySQL://localhost:3306/studio
SQLState: 08001
VendorError: 0
Konsolen ausgabe
* Treiber laden
* Verbindung aufbauen
SQLException: No suitable driver found for jdbc:mySQL://localhost:3306/studio
SQLState: 08001
VendorError: 0
Code:
try {
System.out.println("* Treiber laden");
// Class.forName("src.org.gjt.mm.mysql").newInstance();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
}
catch (Exception e) {
System.err.println("Unable to load driver.");
e.printStackTrace();
}
try {
System.out.println("* Verbindung aufbauen");
String url = "jdbc:mySQL://"+hostname+":"+port+"/"+dbname;
con = DriverManager.getConnection(url, user, password);
System.out.println("* Datenbank-Verbindung beenden");
con.close();
}
catch (SQLException sqle) {
System.out.println("SQLException: " + sqle.getMessage());
System.out.println("SQLState: " + sqle.getSQLState());
System.out.println("VendorError: " + sqle.getErrorCode());
sqle.printStackTrace();
}