• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Installation of a Connection Pool Class on a Mac

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Elton Hughes
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use dbcp for connection pooling on tomcat and it works great. It is out of the box on tomcat 4 and 5 and is fairly easy to configure. Let me know if you would like me to post the config...
mark
 
Elton Hughes
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,
Yes please! I am very interested in your configuration.
Thanks,
Elton
 
mark mathis
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
go to
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
and follow the instructions... You will have to edit the server.xml and web.xml file of your app. Once you get the ds configured it's simply a matter of doing a jndi lookup for the ds.
I apologize that I couldn't post my server.xml file. It's on my mac at home...
good luck!
mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic