> I'm trying to build a connector such that the browser will retrieve
> data from mysql, which resides on the same server.
> If this connector code isn't to be used within GWT, where would it be
> used?
The connector has to be used in the classes that reside on the server-side
only, so if you put the class into the client-package or another package
you added to the list of source-paths in the GWT-XML you will run into
problems.
If you are sure that you use these classes in server-classes only,
you might post your GWT.xml here, so we can check if you mis-
configured something letting the GWT-compiler think that the
server-package should be compiled to JS.
Regards, Lothar
You're definitely doing it wrong.
> I've been trying to put the connector in the same class as the client
> code which tries to connect and retrieve records and etc.
> If I put the connector in a class which resided on the server, would I
> then just import that in the client class in order to use its methods?
Nope--all direct DB communication must remain on the server. There's
no way to run JDBC-over-HTTP, and the client code runs in the browser.
> It would be nice if there were a complete working example somewhere
> online!
Search the mailing list history for JDBC, database connection, etc.
This topic comes up quite frequently as new users try to connect to a
database for the first time.
The quick summary is that only the server can talk to the DB. If you
have a choice of back-end technology, Java is the easiest because then
you can use GWT-RPC to talk to the back end and you have all of JDBC
available to you on the server. If you don't have a choice and Java
is not on the table for server-side tech, you'll have to come up with
an alternate to GWT-RPC and JDBC, but there's lots of choice in both
spaces.
Ian
Yep.