Newbie question : getting DataSource from Sun Application server 9

Discussion in 'Java' started by Cerveza Mas Fina, Jul 17, 2007.

  1. 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();
     
    Cerveza Mas Fina, Jul 17, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cheok Yan Cheng
    Replies:
    0
    Views:
    665
    Cheok Yan Cheng
    Apr 21, 2004
  2. Ulf Meinhardt
    Replies:
    0
    Views:
    432
    Ulf Meinhardt
    Nov 11, 2004
  3. Replies:
    0
    Views:
    2,911
  4. Cerveza Mas Fina
    Replies:
    0
    Views:
    298
    Cerveza Mas Fina
    Jul 17, 2007
  5. Cerveza Mas Fina
    Replies:
    1
    Views:
    349
Loading...

Share This Page