My application requirement is to design a search engine which queries the database given a search criteria and displays the results in a JSP. What is the advantage of using a Session Bean for database operations , over directly using a JDBC API to do database operations in a Java class?
SCJP, SCJD, SCWCD, SCBCD, SCEA
posted 15 years ago
The difference is huge. The session bean is in a container, which will do mutithreading, transaction control, security control, pooling, and others for you for free. If you have 100 clients to access the database the performance is a big issue. You java class cannot handle this as well as a session bean. Also, if it is a stateful session bean, it cache the state on server side and saves traffic.
Jun Hong<br />SCJP, SCJD, SCWCD, SCEA<br />IBM Certified Systems Expert(V4.0)