I create a connection with Java and mm.mysql-1.0.
I 'm running and this the complier messages :
SQLException: General error: Access denied for user: '@localhost' to database 'link'
SQLState: S1000
VendorError: 1044
java.lang.NullPointerException
at conectiondb.ConnectionDB.<init>(ConnectionDB.java:41)
at conectiondb.Application1.main(Application1.java:11)
Exception in thread "main"
private Connection C;
public ConnectionDB()throws IOException,SQLException{
/* Properties info = new Properties();
FileInputStream in = new FileInputStream("d:\\jdbc\\ConnectDB.properties");
info.load(in);
String url="jdbc:mysql://localhost:3306/link";*/
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
}catch (Exception E) {
System.err.println("Unable to load driver.");
E.printStackTrace();
}
try {
C =
DriverManager.getConnection("jdbc:mysql://localhost:3306/link?user=root&password=dma633stk");
}
catch (SQLException E) {
System.out.println("SQLException: " + E.getMessage());
System.out.println("SQLState: " + E.getSQLState());
System.out.println("VendorError: " + E.getErrorCode());
}
Thanks for your assistance.