Oracle Weblogic Server (MOSC)

MOSC Banner

javax.naming.NameNotFoundException: Unable to resolve

edited Mar 9, 2011 8:27AM in Oracle Weblogic Server (MOSC) 6 commentsAnswered
 Hi,

I have set up a jdbc data source in my weblogic server called dev_pacp in JNDI name connections that targets the AdminServer. The data source tests successfully. I found the following code to  connect to this data source. As follows:

When I run it it provides the above exception. Please help.  Thanks  Andy

    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY,
           "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL, "t3://sandbox:7001");
    ht.put(Context.SECURITY_PRINCIPAL, "weblogic");
    ht.put(Context.SECURITY_CREDENTIALS, "weblogic1");

    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;

    try

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center