Hello All, I am working my way through David Harms' book "JSP, Servlets, and MySQL". He recommends installing a connection pool. I found the one he recommended and downloaded it to my Mac. When I untar-ed it, I ended up with a com folder containing a javaexchange folder containing a dbConnectionFolder containing a DBConnectionBroker class. Oh Ok, my first thought was to place it /Library/Java/Extentions. But, that directory contains jar files. Not good. And, sure enough, I tried to compile a little test class and it did not work.
-> javac Example1.java Example1.java:7: package com.javaexchange.dbConnectionBroker does not exist import com.javaexchange.dbConnectionBroker.*;
Any thoughts? Thank you for your time. Elton [ March 08, 2004: Message edited by: Elton Hughes ]
There's no difference on a Mac than anywhere else. The folder structure you found in the tarball is the package hierarchy for the class and it must be maintained. Did you copy just the class file? I've never tried to dump something in Ext -- I deal exclusively with web apps where the classpath is maintained by the servlet container -- so I'm not sure if you can root a non-jarred class hierarchy there (Bueller? Bueller? Anyone?), but perhaps you can jar up the class (with the complete package folder structure) if not.
Hello Bear, Thank you for your response. I placed the whole structure in /Library/Java/Extentions, not just the class. When that did not work, I placed just the class in /Library/Java/Extentions. When that did not work I placed both the whole structure or class in Tomcat's common/classes and common/lib directories. Nothing worked. I then went to the book's website and downloaded all of the sample code I could and examined it. To my surprize, the author did not use that class anymore. He rolled his own you might say. All I want to do is put togther a small webapp to keep track of companies and contacts. It should not be this hard. But since my background is in databases and not Java, I guess this is part of the learning curve. It is good having a place to ask Mac questions. But now it's time to head on over to the JSP, Servlet, and maybe Struts forum and settle in there a bit. Thank you for your time and patience, Elton
Heading to the forums you mentioned is a good idea since, especially in the web app arena, there's really no Mac specifics. I'll just add that since this is a Tomcat web app, you shouldn't need to fiddle with the system classpath at all (Tomcat ignores it). Your app-specific classes should go in WEB-INF/classes or WEB-INF/lib (non-jarred and jarred respectively), and your app-agnostic classes in $CATALINA_HOME/shared/lib. See ya in the other forums!