How to create a java class(with/without main) to access websphere datasource
Rashmi Birur
Greenhorn
Joined: Aug 29, 2001
Posts: 4
posted
0
Hi, I am using hit.db2.Db2Driver to access DB2. I have created a datsource by using websphere test environment of VAJ . I am using the datasource in a bean class(java class without main()) and executing the query. code is here
When i access this bean from a servlet then it works but when i try to access it from a main() method of a simple java class it gives me this error: Uncaught exception in evaluation: java.lang.NoClassDefFoundError: javax.naming.InitialContext I was able to compile it successfully but when i do Run Main i get the above error. Somebody ahd suggested to copy the ioser12.dll from websphere/appserver/jdk/jre/bin to WINNT/system. But it didn't work. Please let me know what i have to do regarding this. Do i have to change the classpath ? please reply thanks rashmi