----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
I would propose that you switch to the v2 drivers. They are somewhat
faster, and support jdbc 2.0
Ulrik
At 17:05 24-07-00 +0300, Andras Balogh wrote:
>----------------------------------------------------------------
>BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
>WHEN YOU POST, include all relevant version numbers, log files,
>and configuration files. Don't make us guess your problem!!!
>----------------------------------------------------------------
>
>Hi Joe,
>
>I am succesfully connecting to Mysql using the code:
>
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> Connection con=DriverManager.getConnection
>("jdbc:mysql://localhost:3306/statistica", "andras", "apple");
> where andras is the username and apple is the password.
> If you can connect from PHP3 than it means that mysql grant tables are set
>up correctly.
>My guess is that the JDBC driver is old in your case.
>Try to download a newer version of the driver, my driver version is 1.2c
>(http://www.worldserver.com/mm.mysql/dist/mm.mysql.jdbc-1.2c.tar.gz)
>
>
>Keep it touch,
>
> Andras.
>
>
>----- Original Message -----
>From: Joe Sheble a.k.a. Wizaerd <[EMAIL PROTECTED]>
>To: Java Apache Users <[EMAIL PROTECTED]>
>Sent: Monday, July 24, 2000 4:33 PM
>Subject: FW: Need some help with JDBC
>
>
> >
> > I really hate to do this because I'm not sure it's a JServ problem. I had
> > posted it on Friday to the mySQL mailing list, and recieved some 'me too'
> > answers, but nobody had a solution, so I thought I'd try here anyways.
> >
> > I'm using Apache 1.3.12 with ApacheJserv 1.1.2 and mySQL 3.22.32 running
>on
> > localhost. I can connect via the console with my username 'root' and
> > password I have set up. I can connect via PHP4 using the same username
>and
> > password, however when trying to connect via Java using the mm.mySQL JDBC
> > drivers, it won't connect. Would anybody know what I should be looking at
> > to correct this?
> >
> > The code in question is:
> >
> > try {
> > // The newInstance() call is a work around for some
> > // broken Java implementations as noted in mm.mySQL docs
> > Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> > }
> > catch (Exception E) {
> > out.println("Unable to load driver.");
> > E.printStackTrace();
> > }
> >
> > try {
> > Connection C =
> >
>DriverManager.getConnection("jdbc:mysql://localhost/JavaTest?user=root&passw
> > ord=chablis");
> > C.close();
> > }
> > catch (SQLException E) {
> > out.println("SQLException: " + E.getMessage() + "<BR>");
> > out.println("SQLState: " + E.getSQLState() + "<BR>");
> > out.println("VendorError: " + E.getErrorCode() + "<BR>");
> > }
> >
> > Here's what gets printed in the browser:
> >
> > SQLException: Server configuration denies access to data source
> > SQLState: 08001
> > VendorError: 0
> >
> > In the getConnection() I have tried all sorts of combinations:
> > Connection C =
> >
>DriverManager.getConnection("jdbc:mysql://localhost:3306/JavaTest?user=root&
> > password=somevalue");
> > Connection C =
> > DriverManager.getConnection("jdbc:mysql://localhost/JavaTest", "root",
> > "somevalue");
> > Connection C =
> > DriverManager.getConnection("jdbc:mysql://localhost/JavaTest",
>"user=root",
> > "password=somevalue");
> >
> > Could somebody, anybody help me out with this?
> >
>
>
>
>
>--
>--------------------------------------------------------------
>Please read the FAQ! <http://java.apache.org/faq/>
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>Search Archives:
><http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
>Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search Archives:
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]