I agree ... better docs would be great, but I for one won't be making too much noise unless I have the time to contribute them. I've followed this list for about 4 months now and have learned a lot.
For apps deployed with TC 3.3 and 4, the directory tree you laid out doesn't follow spec. It should look more like this: myApp --> myjsppage.jsp --> other jsps and static content (ie .gif, .jpg, etc....) --> WEB-INF -->classes -->lib -->mm.mysql-2.0.6.jar Also, let's not confuse applets and servlets. I believe that's happening a little in this thread. Applets (to my understanding) are executed on the client and as such are available to the client like any .html file. Tomcat isn't involved in that arena. Servlets on the other hand, are only executed on the server and should be under WEB-INF (except .jsp files) either in a .jar file under lib or in a package structure under classes. For servlets, the JDBC driver for mysql as downloaded needs to be unjarred and the .jar file within placed in either (a) WEB-INF/lib if it's used only by the one app (b) in TOMCAT_HOME/lib for use by all apps or (c) TOMCAT/common/lib for all apps and TC (might be TC 4 only). I wouldn't recommend unjarring the JDBC driver itself into a set of .class files. That's just too messy to even contemplate unless all other options are exhausted. After placing the .jar file, restart Tomcat so it can find the jar file. Should work after that. Hope this helps. --David Smith On Wednesday 21 November 2001 09:23 pm, you wrote: > Hi ya, > > Let's share this with the others ;-), and I think this should be mentioned > in the docs. > > Anyway, here how I do it, I place the *driver directory tree* in the > directory as the other class files. For example, my servlet application is > called, myApplet, and I put all the class files for this app in myClasses, > so the directory tree will look like this, > > myApplet-->myApplet.jsp > > ---->myClasses > > ------>(class files for the applet) > > ------>org(this is for the MySQL driver) > > ---->gjt > > ---->mm > [...] > > See the deep directory tree for the driver, but all you need to do is unjar > it. If you use WinZip, right click on the driver file and unzip (unjar) > it. I hope you will find this useful. > > ----- Original Message ----- > From: "Satish Talim" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, November 20, 2001 3:30 PM > Subject: Location of jdbc driver > > > Hi, > > > > I am facing the same problem. I am not sure where I should place the > > mySQL jdbc driver files. What has been the solution? > > > > My servlet uses JDBC and throws a page with an applet. Then via > > HttpURLConnection I have to do applet/servlet communication... > > > > Regards, > > > > Amit Lonkar > > ----- Original Message ----- > > From: "Yiu Wing" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Monday, November 19, 2001 12:41 AM > > Subject: [repost] loading class files > > > > > Sorry guys this is a repost. But after doing numerous google search > > > and wading through the docs, I still can't solve my problem with > > > regard to loading applet classes. I sincerely hope some of you can > > > help me this > > > > time, > > > > > I desperately need to get this working. The same message is as follow. > > > > > > Hello All, > > > > > > I'm writing an applet that uses JDBC to connect to MySQL server , and > > the > > > > applet is embedded in a jsp. I'm new to this, so I went on and read > > > the docs that come with Tomcat. I'm also using CVS and ant for the > > > > development. > > > > > The source code layout of my project is as suggested in the docs, > > > which > > is > > > > project name > > > > > > |----- docs > > > |----- src > > > |----- web > > > |------>WEB-INF > > > > > > In the project/web/WEB-INF directory, do I have to create a classes > > > and > > > > lib > > > > > subdirectories? The reason I ask this is because the class loader, > > > from > > > > the > > > > > Tomcat or web browser, can't find the class files. But they're clearly > > in > > > > the web directory, whose structure is as, > > > > > > project > > > > > > |---- login.jsp (that's the jsp file that embeds the applet) > > > |---- WEB-INF > > > |------- classes (this directory has all > > > > the > > > > > needed class files) > > > > > > |------- lib (where the MySQL driver is > > > > > > stored) > > > > > > The Tomcat docs says the classes and lib dir "are made visible to > > > other classes within your particular web application", but why my > > > class files can't be loaded there? If I move all the class files to > > > the top of the > > > > web > > > > > directory, and change "code="MyClass.class"" to "code="MyClass"" in > > > the > > > > jsp > > > > > file, then everything seems to working OK. Oh, yeah, almost forgot, I > > also > > > > need to copy the whole directory tree for the driver to the web > > directory > > > as > > > > > well. Setting the classpath for the driver doesn't work. I don't want > > to > > > > copy the class files to the top of the web directory every time, can > > those > > > > file be loaded in the classes and lib directories. Sorry about this > > > > rather > > > > > long message, but I'm getting very frustrated and hopping some of you > > can > > > > help me with this. > > > > > > Thanks for your help in advance. > > > > > > P.S. I'm using Tomcat4.0 on Win2000 > > > > ______________________________________________________________________ > > Quick Heal Eudora Plugin has scanned email for known viruses, trojans and > > worms. > > > www.quickheal.com > > -- > To unsubscribe: <mailto:[EMAIL PROTECTED]> > For additional commands: <mailto:[EMAIL PROTECTED]> > Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>