i was aked this question in a mock exams
1 posts in topic
Flat View  Flat View

Posted By:   Bhaskar_Kommuru
Posted On:   Friday, April 5, 2002 02:26 AM

How would you lookup an 'orders' database using jdbc-jndi in a session bean?

A: DataSource orders = (DataSource) jndiCtx.lookup("java:comp/env/jdbc/Orders");
B: Database orders = (Database) jndiCtx.lookup("java:comp/env/jdbc/Orders");
C: DataSource orders = (DataSource) jndiCtx.lookup("java:comp/Orders");
D: JNDI can't be used with JDBC

Can anybody help me?

Re: i was aked this question in a mock exams

Posted By:   Jonathan_Tam  
Posted On:   Thursday, April 18, 2002 05:58 PM

A (correct)

B - You lookup a DataSource, not a Database

C - java:comp/env/jdbc/Orders follows the java:comp/env as well as the jdbc conventions. This answer does not

D (false)

I hope that helps.... I hope I'm right...
About | Sitemap | Contact