Skip to Content
Former Member
May 20, 2004 at 05:13 AM

Reading JDBC DataSources on J2EE engine



I am developing a tool that will export the SAPDB table data into XML format.

For doing the above i've configured a DataSource in J2EE engine.I can use the above created driver in my code to get all the records of particular table and i can create a XML file from that using the following code.

"DataSource ds = (DataSource) ctx.lookup("jdbc/Reviewmanagement");"

where "Reviewmanagement" is the drivername in my J2EE engine.

Now my question is , i don't want to hardcode the drivername in my code. I want to read the driver/DataSource information programatically so that the same application i can deploy/run on any J2EE directly witout doing any modifications.

So please let me know how to read the DataSources/Drivers configured on J2EE.

Thanks & Reagrds