Updates

Latest Tweet



What's New?

Check out for latest innovation, a computer based training video collection


Like this Page

Core JSP Review by P. H PICOT

Excellent book for JSP JDBC-to-Oracle developers

This is a good book under any circumstances, and if you develop with Oracle, it is even better, because there are many examples of JSP and Oracle JDBC, and while JSP/JDBC is intended to be database independant, it is easier to learn when the code is written for the database you use. There is a lot of useful information that will help you speed up your connections, pooled connections (which Oracle supports), and techniques for using synchronized statement to protect them. Synchronization is familiar to thread users, but well explained if you aren't familiar with the concept.

One thing the authors omit is setting autocommit off after making your JDBC connection. The idea of autocommit is to make JDBC "friendly" to certain non-Oracle databases, but if you understand transactions, you want to control when a commit occurs, and undo the entire transaction if you don't like it. To quote Tom Kyte, you never want to commit until you have to (slows database down) and you never want to commit part of a transaction. If your procedure should just update a single row, you can check the result before you commit. Setting all the banks accounts to zero may not be a transaction you will chose to commit. Checking a result is easier than explaining one. This is the kind of database specific information that perhaps authors writing for many platforms should ignore, but you may find it useful if you work with Oracle.

The authors show you how to use bind variables with prepared statements, and callable statements, but don't really go into the downside of not taking their advice; if you don't use bind variables, you will not have a scalable application. A lot of JSP examples (even in Oracle documention) do not bother with bind variables (example code is shorter if you don't) but "Core JSP" shows you code that is proper for scalable applications, and you can follow it (use the examples you find elsewhere as concepts, not as code to put in your applications).

This is a tiny portion of what this book will teach you, and if you are new to JSP and want to get a non-trivial application working, and scalable, this is a good place to start (also this is not an expensive book, which helps). This is all you need to get started, and see the value of JSP.