If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Cannot instanciate com.ibm.websphere.naming.WsnInitialContextFactory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-01-06, 12:04
harrypeh harrypeh is offline
Registered User
 
Join Date: Sep 2006
Posts: 2
Cannot instanciate com.ibm.websphere.naming.WsnInitialContextFactory

Hi all,

I would like to connect remotely to the DB2 in linux machine using the JNDI lookup.

In websphere development 5.1, this portion of code is working in 5.1 env :

/////////////////////////////////////////////////////////////////////////
Context MyCtx = null;
DataSource MyDS = null;
Hashtable parms = new Hashtable();
Connection conn = null;

parms.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory ");

MyCtx = new InitialContext(parms);
MyDS = (DataSource) MyCtx.lookup("jdbc/Employee");
conn = MyDS.getConnection();

/////////////////////////////////////////////////////////////////////////

But after i recompile in websphere rational 6.0, the code is not working anymore. It said :

=> Cannot instanciate com.ibm.websphere.naming.WsnInitialContextFactory. .

I have imported the db2jcc.jar, db2jcc_license_cu.jar, can anyone giv me some clue what is happening? Thanks alot.
Reply With Quote
  #2 (permalink)  
Old 09-01-06, 13:28
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I think this question will better belong to a java or a websphere group


Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On