Newbie question : getting DataSource from Sun Application server 9

C

Cerveza Mas Fina

Hello All :

I have been asked to write a remote client that needs to get a Oracle
connection object from
a Connection pool on a Sun Application Server 9 system.

I have not found any resources that are specefic to Sun App server and
dont have much
idea about how to do this. This is what I could gather so far .. am I
even going the correct way ?

What sould I put for the INITIAL_CONTEXT_FACTORY & PROVIDER_URL ?

Please have patience if this is a dumb question.

Thanks




Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put( Context.PROVIDER_URL, "http://Server101:8080/" );

// Get Initial Context
InitialContext context = new InitialContext(env);
// Get the reference of the home Object
Object obj = context.lookup("java:comp/env/jdbc/OracleJndi");
DataSource ds = (DataSource)obj;

......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top