I've read a lot of articles and guides in JDBC connection pooling, and all of them involve the use of JNDI lookup to retrieve a DataSource. I'm wondering if it is required to use JDNI in order to create a pooled connection? Or I can simply instantiate the driver class as follows:
The reason why I'm looking into alternatives that doesn't involve JNDI is due to a bug between WAS and the Oracle driver. I am unable to register OracleConnectionPoolDataSource into the WAS JNDI context correcty (the datasource got registered into the context but returned as "com.ibm.ejs.cm.JDBC1PhaseRF", a class that cannot be casted into sql.javax.DataSource). [ August 12, 2002: Message edited by: Felix Kan ]
Hi there Felix, Your proposed approach will work just fine! At least, I have been working like that for about a year now without problems. On the other hand: if I were you I 'd try and get around the configuration issues. Creating the data source from scratch is just an ugly workaround, after all. Good riding, Rudy.
Felix Kan
Greenhorn
Joined: Aug 12, 2002
Posts: 8
posted
0
Rudy, Yahoo! Thanks a lot for your quick reply! This is my first post on javaranch The ClassCastException problem between WSAD (WebSphere Studio Application Developer... an Eclipse-based product) and Oracle still remains to be a mystery. I've spotted a few threads on the Websphere thread and there isn't a clear solution to it. Yeah it's really bad to have all these ds settings hard-coded into the source code, but at least for now I can settle with the help of Ant build files. Cheers, Felix
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Connection Pooling - is JNDI the only way?