Newbie question : getting DataSource from Sun Application server 9

C

Cerveza Mas Fina

Hello All,

I have been asked to write a client that uses a Oracle Connecton
object from a connection pool set up
on a Sun App Server 9. I have found quite a few resources for Weblogic
but none for Sun App Server
can someone help me ?

I am a newbie so, please do have patience If I have everything fubar-
ed :)

This is what I got so far ...


....
....

Hashtable env = new Hashtable();

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

// Get Initial Context
InitialContext context = new InitialContext();

Object obj = context.lookup("java:comp/env/jdbc/SampleJndi");
DataSource ds = (DataSource)obj;
conn = ds.getConnection();
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top