Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Best way to access JNDI configured DataSource from outside container

843859Aug 3 2005 — edited Aug 3 2005
I'm not sure if this is the right forum category, but it seemed like a good place to start.

I have a DB2 database on an OS/390 mainframe that is configured as a JNDI datasource in WebSphere (WSAD) 5.1.x. I can get connections and do database transactions within my web-application just fine.

Part of my project needs a cron managed stand-alone application to do some database clean up work. It essentially needs to query one database, and then based on the results stick some data into the DB2 database. Easy enough right?

The issue here is that our Security department will not under any circumstances give us the passwords and users for either database. They give these only to the server admins who configure WSAD. We also can't use a properties file. The server admins either won't touch any properties file (it is considered "code" and they don't want to be responsible for problems) or they won't have access to the contents of the ears or jars we give them. This basically leaves us with our JNDI datasource as the only datasource we could access (because the admins will have it configured with a username and password). There is also no way to infer a valid username/password from the owner of the web-app since it will live on an NT box and the NT user won't have mainframe rights.

There is also no possibility of bending these rules no matter how stupid or cumbersome they are.

So my question is, what is the best method in which to gain access to this JNDI DataSource or a Connection from this DataSource? Can I even get a DataSource from a JNDI lookup? Is JMS/RMI or some other acronymn that I don't know about the only way to acomplish this?

We're using Struts MVC -> Spring -> Hibernate in the webapp, if that helps.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2005
Added on Aug 3 2005
3 comments
292 views