jQuery in Action, 3rd edition
The moose likes JBoss/WildFly and the fly likes Database Class in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Database Class in JBoss" Watch "Database Class in JBoss" New topic

Database Class in JBoss

Alex Kravets
Ranch Hand

Joined: Jan 24, 2001
Posts: 476
Hi guys,

I have a class that has static methods which select and update database. It basically used as like this: DBDriver.doSelect(databaseName,sqlQuery) and returns a vector with results. Now this works if I put class in app.war/WEB-INF/classes/ directory, but what if I want to use this class in other applications? Do I have to copy this class to every application's WEB-INF/classes directory or is there some place I can keep it globally? Should I jar it and put in my CLASSPATH?


All right brain, you don't like me and I don't like you, but let's just do this one thing so I can get back to killing you with beer.<br /> <br />- Homer Simpson
Anthony McHenry.

Joined: Mar 16, 2003
Posts: 9
Why don't you make your class a local session bean? That would solve your problem. And then you could make these db calls from anywhere on the planet.
It is sorta covered in the JavaRanch Style Guide.
subject: Database Class in JBoss
jQuery in Action, 3rd edition