Ask Experts Questions for FREE Help !
Ask
    rajesh561's Avatar
    rajesh561 Posts: 2, Reputation: 1
    New Member
     
    #1

    Nov 5, 2013, 11:03 PM
    I have to connect multiple hostnames dynamically by using JNDI
    Please help me,

    My problem is to connect multiple hostnames dynamically by using JNDI. I am using the JNDI,

    InitialContext ic = new InitialContext();
    Context envCtx = (Context) ic.lookup("java:comp/env");
    javax.sql.DataSource ds = (javax.sql.DataSource) envCtx
    .lookup("jdbc/MYDB");
    con = ds.getConnection();
    “jdbc/MYDB” is my JNDI name. It was configured in context.xml file in Tomcat.Like

    I have different host address like 1)abc.com 2)xyz.com…. Abc.com have the some users and xyz.com also have the some users when abc.com users login to my application then “url” must be replaced with abc.com and when xyz.com users login to my application then “url” must be replaced with xyz.com.

    Thanks in Advance……

Check out some similar questions!

How do I connect multiple china balls together to work like christmas tree lights? [ 0 Answers ]

I want to hang a bunch of china balls that are all connected to one AC cord that plugs into an outlet. (can't modify switch) Any ideas for this?

I am using a cable for internet,how to connect to multiple pcs [ 3 Answers ]

Sir,I am using a cable for internet and I am from INDIA.I am having two computers and a laptop in my house.I want to use only one internet connection to all these computers.waht are the possible ways to use the same connection.can I work with internet on those computers simultaneously. Help

Can we get Database Schema from XSD that create JSP dynamically [ 3 Answers ]

Is it possible to input an XSD and read database schema from this to create JSP dynamically based on database and their relationships? If its possible then how?


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.