Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Newbie question : getting DataSource from Sun Application server 9

Thread view: 
Cerveza Mas Fina - 18 Jul 2007 15:50 GMT
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;

.....
Lew - 18 Jul 2007 15:54 GMT
> Hello All :
>
[quoted text clipped - 6 lines]
> 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.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.