EJB ?

S

Shinya

I just found the bean class to connect db with servlet.
I found this line in constructor.
(DataSource)javax.naming.InitialContext.lookup("java:comp/env/jdbc/bn");

This means this guy is using ejb to connect to DB?



Shin
 
T

Thomas Hawtin

Shinya said:
I just found the bean class to connect db with servlet.
I found this line in constructor.
(DataSource)javax.naming.InitialContext.lookup("java:comp/env/jdbc/bn");

This means this guy is using ejb to connect to DB?

No, that's JNDI.

You can use JNDI to look up EJBs, but it's much more general than that.
It just means the connection information doesn't have to be wired
somewhere in the war. It can be configured through the container instead.

Tom Hawtin
 
S

Shinya

Thanks, Tom for prompt reply.

but how can I register this name java:comp/env/jdbc/bn?
Through Application server? I have installed the Tomcat on my machine.
Do I have to install JBoss upon that?

Shin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top