how to use DataSource in stand-alone core java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sri_R
Posted On:   Thursday, September 8, 2005 05:45 AM


can any one explain, what the parameter in the code given below mean for




DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/firstDSN")




i.e wat java:comp means, wat env means, wat jdbc/firstDSN means...



also if possible give simple example for using DataSource in standalone java
thanx in advance

Re: how to use DataSource in stand-alone core java

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, September 10, 2005 04:39 PM

It depends on the kind of server that your JNDI InitialContext will be coming from. The "java:comp/env/" prefix is used by some JNDI services (like IBM WebSphere) but not by others (e.g. WebLogic uses its own "t3:" instead) ...



I am still confused by all this myself. But anyway, you end up looking up the name "jdbc/firstDSN", in some sort of namespace, and you just have to specify the right namespace for your particular JNDI server.
About | Sitemap | Contact