You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Programmatically accessing DBCS using java- javax.naming.CommunicationException

edited Jun 27, 2017 7:00AM in Middleware 5 comments

Summary

Programmatically accessing DBCS using java- javax.naming.CommunicationException

Content

I have a java program which will be deployed to JCS. We have created one table which will be used by our java program.

To interact with DBCS, i have created data source in my jcs weblogic console and trying to access as shown below

OracleConnection conn=null;

    javax.sql.DataSource ds=null;

    Hashtable env = new Hashtable();

    env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );

    env.put(Context.PROVIDER_URL, "https://<host>:7002");

    try{

      Context context=new InitialContext( env );

      //you will need to have create a Data Source with JNDI name testDS

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!