man.. thank you.. this worked!!! I want to know one thing, however,
that has me a bit confused..
this is code now:
String url = "jdbc:mysql://localhost:3306/one?user=root&password=XXXX";
Class.forName("com.mysql.jdbc.Driver").newInstance();
how does Tomcat know where to find db? which is in
C:\Program Files\MySQL\MySQL Server 4.1\data
how on earth does Tomcat know how to find db?
(I mean "localhost:3306" still doesn't specify path to db.... right?)
it knows how to find driver, b/c I put it in Tomcat location where you
told me, but this says nothing to Tomcat about where db is.. (or even
tell the driver where to find db.. does this make sense?)
again many thanks...... :) Frances
> Put the Connector/J JAR-file in the directory <tomcat-install>/common/lib
> and then try to connect from a Servlet or JSP. This should work.
[quoted text clipped - 27 lines]
>>how do I connect? is it possible at all to connect to a MySQL db from
>>Tomcat w/in a local machine? thank you.. Frances
Arnaud Berger - 21 Apr 2005 15:07 GMT
Hi,
When you connect to port 8080 of your tomcat, you also don't have to know
where tomcat is installeds but
you just want the page you required to display, right ?
The database just got an open socket on port 3306, waiting for client
connections.
once a client connects, begins a dialog through this socket, in which the
client sends his requests, and
in which the db just send its results.
It's as simple as that.
Regards,
Arnaud
> man.. thank you.. this worked!!! I want to know one thing, however,
> that has me a bit confused..
[quoted text clipped - 47 lines]
> >>how do I connect? is it possible at all to connect to a MySQL db from
> >>Tomcat w/in a local machine? thank you.. Frances