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, "t3://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;

......
 
L

Lew

Cerveza said:
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 ?

I would start at the main resource specific to the Sun App Server:
<http://java.sun.com/javaee/community/glassfish/index.jsp>
which leads to
<http://docs.sun.com/app/docs/doc/819-3656/6n5s3qjg2?a=view>

Btw, it's enough to ask your question once.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top