> I can't access MySQL using Java on Linux!  It's killing my project.   I
> can access that very MySQL from PHP just fine.   I have the same
> database running on Windows so I can develop what I need to.  Just
> can't run anything for our users!!!
>
> I don't think it's the firewall because I get the same error when I run
> locally on the box.
>
> Anyone face this before?   I need HELP.
>
>
>
How are you trying to connect?  You need a JDBC connector.  You must
"register" the connection.. The current connector is Connector/J (see
www.mysql.com)

Basically you need to have it in the class path of java compiler (i.e, the
user who runs javac either explicitly or "tomcat" for .jsp pages. Its
similar to having to get "pear" going in php.

If you can be more specific the list can be of more help.  I'm  currently
using an earlier version of the driver so you will have to subsititute
connector/J equivalent:

for a bean:

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.DriverManager;
import java.sql.Statement;

        this.DBUrl = "jdbc:mysql://localhost:3306/"+dbname;
        try {
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            this.conn =
DriverManager.getConnection(this.DBUrl,this.dbuser,this.dbpasswd);
        }
        catch (Exception e) {
            e.printStackTrace();
        }

Hope this helps..

William R. Mussatto, Senior Systems Engineer
Ph. 909-920-9154 ext. 27
FAX. 909-608-7061



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to