Just to test replcae the appropriate line with the following:

DriverManager.getConnection("jdbc:mysql://localhost/test?user=monty=greatsqldb");

Cheers ... Gavin

-----Original Message-----
From:   Shao [SMTP:[EMAIL PROTECTED]]
Sent:   28 February 2001 09:02
To:     [EMAIL PROTECTED]
Subject:        Help: jdbc for mysql

Hi, all

I think this is a very simple question but disturb me deeply. When i run
these
codes:
         import java.sql.*;
         public class LoadDriver
         {
             public static void main(String[] Args)
             {
                try {
                    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                    System.out.println("Load OK!");
                }
                catch (Exception E) {
                    System.err.println("Unable to load driver.");
                    E.printStackTrace();
                }
           try {
                Connection C = DriverManager.getConnection(

"jdbc:mysql://localhost:3306/mydb?user=mysql&password=");
            }
            catch (SQLException E) {
              System.out.println("Error in connect");
              System.out.println("SQLException: " + E.getMessage());
              System.out.println("SQLState:     " + E.getSQLState());
              System.out.println("VendorError:  " + E.getErrorCode());
            }
      }
it' output likes below:
    Load OK!
    Error in connect
    SQLException: Cannot load connection class 'java.sql.SQLException:
Server configuration denies access to data source'.
    SQLState:     08001
    VendorError:  0

Why cannot load the connection class?
My environment is: mm.mysql.jdbc-2.0pre5 + mysql-3.23.30-gamma + jdk1.3 +
redhat6.1 +(tomcat3.2 + apache3.12)

 Please help me
Thanks
shao

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to