File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes exception when using WAS connection pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "exception when using WAS connection pool" Watch "exception when using WAS connection pool" New topic
Author

exception when using WAS connection pool

Jian Yi
Ranch Hand

Joined: Feb 01, 2002
Posts: 127
I got this error when I tried to use Websphere connection pool.
java.sql.SQLException: Message file 'oracle.jdbc.dbaccess.Messages' is missing.
Did anybody get that? How do I fix it?
My code to use websphere connection pool is:
try {
java.util.Properties parms = new java.util.Properties();
parms.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
javax.naming.Context ctx = new javax.naming.InitialContext(parms);
// look up the desired data source
DataSource ds = (javax.sql.DataSource) ctx.lookup("jdbc/VWDB_DS");
Connection con = ds.getConnection();
} catch (Exception ex) {
System.out.println(ex);
}
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
Jenny,
Looks like you are getting an SQL Exception and the code is not able to access the message file to tell you what the exception is.
This could be a problem with the way the JDBC Driver is installed.
Could you check that this file is available in the JDBC Driver zip file... If u are using Oracle, I presume u would have classes12.zip somewhere in your path...


Best Regards,<br />Nagendra Prasad.
Jian Yi
Ranch Hand

Joined: Feb 01, 2002
Posts: 127
Thanks a lot!!! It's working!!! wow~~~
Jian Yi
Ranch Hand

Joined: Feb 01, 2002
Posts: 127
Hi Prasad,
Shall I close the DataSource and Context at the end? I know I need to close the connection. But not sure about those two.
Thanks,
Jenny
Bhupesh Kokate
Greenhorn

Joined: Jul 18, 2003
Posts: 22
I think DataSource handling is Websphere's job in this case ...
Bhupesh
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
Hi Jenny,
Sorry was not tracking this post for some time.. you might have had all your queries resolved by now.. but a pointer all the same:
the datasource is generally initialised the first time anything is needed
from the system.
Then we use it to obtain the connections we need.
We close the connections etc once we are done with the 'SQL' bit in the
code.
typically this is the logic used: (Please not this is sytactically incomplete)

So... you dont do anything to the datasource or the initial context. You limit your activities to the connections!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception when using WAS connection pool
 
Similar Threads
Not able to use my datasource using JNDI lookup
Test 483 - Test Question
Not able to get my Datasource using JNDI Lookup
Not able to access my datasource using JNDI lookup
How to Bound JNDI names and references