Tuesday, October 25, 2005

JSP Database Access Best Practices Links

Here are some of the JSP Database access best practices urls: http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/

https://bpcatalog.dev.java.net/nonav/solutions.html

http://java.sun.com/reference/blueprints/ https://blueprints.dev.java.net/

Download the Blueprints book from: https://blueprints.dev.java.net/books.html

There are two ways of accessing database from a JSP page. One using a Java Bean Object, which could be using EJB or POJO (Plain Old Java Object), however EJB and POJO have converged in EJB 3.0.

For pages embedding SQL database access code, its strongly recommended to use JSTL (JSP Standard Template Lib.), which is specified in JSR 052 and here is an coding example from Oracle.

The Database tables needs to be converted to Java objects in many models, there are a few frameworks available for doing it. Notably EJB 3.0 has an excellent architecture. One should also consider Apache Object Relation Bridge , JDO (Java Database Access) and Hibernate (which is EJB 3 compatiable)

One could use Druid, an open source tool for database porting it also have a Java Object generator using Hybernate. A better, free but not open source software exists called C24 IO.

For new development one must seriously consider JSF (Java Server Faces) which is the next logical step from Struts. Its specified by JSR-127. One must not use adhoc models for navigating between pages.

I strongly recommend to follow the coding style specified by Sun.