Are you trying to load the driver in the Server Code, or in the
Client?
You can not connect to a database from the Client Code (Browser
javascript), only from the Server code.

I am using MySql in my projects  using RPC (Servlet).

In my RPC servlet I have code like this that works fine....

public Connection getConnection() throws Exception {
        Class.forName("com.mysql.jdbc.Driver").newInstance();
        Connection c = DriverManager.getConnection("jdbc:mysql://"+host
+"/"+db,
                        login, passw);
        return c;
}

Mike.

On Jun 30, 4:41 am, Hotkey <[email protected]> wrote:
> Dear All,
>
> this is my first post in this group, hopefully i'm not doing anything
> wrong. I've searched for this topic but didn't found any solution.
>
> I'm quity new to GWT and are currently writing my first Client/Server
> example. Actually i want to read some Data from a database but i
> didn't get the connection to work.
>
> At the source
> "Class.forName("org.gjt.mm.mysql.Driver").newInstance();" a
> ClassNotFoundException is thrown.
>
> I'm using Eclipse and have tried the following:
> Project Properties -> Java Build Path -> Libraries -> Add External Jar
>
> Result: still ClassNotFoundException
>
> Manually Copied the file into the WEB-INF\lib directory.
>
> Result:
> ExceptionInInitializerError at the line: this.conn =
> DriverManager.getConnection("<my connection string>"):
>
> Caused by: java.lang.ExceptionInInitializerError
>         at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:
> 282)
>         at java.sql.DriverManager.getConnection(Unknown Source)
>         at java.sql.DriverManager.getConnection(Unknown Source)
>         at
> com.setlog.gwt.servicetest.server.db.DBInterface.<init>(DBInterface.java:
> 69)
>
> Hopefully someone can help me with this

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to