Hi, guys!
I am running mysql 3.22.32 and JDK1.2.2.
I tried mm.mysql.jdbc and twz1 jdbc. All failed.
This is my code for mm.mysql.jdbc-1.2c.
It reports error:
Server configuration denies access to datasource.
Please help me out.
import java.sql.*;
import java.io.*;
public class exesql {
public static void main(String[] args) {
try{
Class.forName(
"org.gjt.mm.mysql.Driver").newInstance();
} catch (Exception E) {
System.err.println(
"Unable to load driver.");
E.printStackTrace();
System.exit(0);
}
try{
Connection
C=DriverManager.getConnection(
"jdbc:mysql://localhost/my_db_which_works",
"the_user_which_works_in_perl_DBI",
"The_password_which_works_in_perl");
// Connection
// C=DriverManager.getConnection(
// "jdbc:mysql://localhost/iun?
// user=the_user_which_works_in_perl_DBI
// &password=
// The_password_which_works_in_perl");
//This reports the same error.
} catch (Exception E) {
System.err.println(
"SQLException:" + E.getMessage());
}
}
}