struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Van Wart <>
Subject Re: [JAVA]How to get datatbase connection from lookup to datatsource name in a standalone java application
Date Thu, 24 Aug 2006 20:35:27 GMT
temp temp wrote:
> My java standalone application wants connection to database with lookup  to datasource
name which is configured in the oc4j app server. 
>   Please guide me with some ideas to achieve this.
You need to bind it yourself, to some provider.  I use the DBCP provided 
with Tomcat (naming-factory-dbcp.jar); the context factory is 
"" (that's not a typo, the 
class name begins with a lowercase letter). Then you create your 
InitialContext, create sub contexts for each component and bind your 
object to the last context.  DBCP is an in-memory one that seems to beat 
the beta fscontext reference that Sun released.

Oracle has a class ''.  I suspect that's 
what OC4J uses.  It also seems to have 
com.evermind.server.rmi.RMIInitialContextFactory.  See if you can find 
javadocs for those.  If you're grabbing a DataSource remotely from a 
running OC4J instance, I did a quick google search and found 
.. it's for TopLink, but it uses JNDI and follows the same conventions 
that your standalone OC4J (or app server) is going to use--JMS or RMI 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message