> I can't connect to a mysql db with an applet and J-Connector although
> the applet is on the same server (from my point of view).
Applets don't typically run on the same machine as a database or web
server. They run on the machine that's running the browser.
Just making sure that you're clear on that,
John
http://schemaspy.sourceforge.net
Francois - 14 Sep 2005 07:06 GMT
OK, what I mean is "my applet should be able to make a connection to
the database, since (I believe) it comes from the same host as the
database". I know that it runs on the pc where the browser is.
Francois
John Currier - 15 Sep 2005 03:29 GMT
How about something like this:
conn = DriverManager.getConnection("jdbc:mysql://" +
applet.getCodeBase().getHost() + ":3306/DB_name", dbUsername,
dbPassword);
John
http://schemaspy.sourceforge.net