Web site development - APPENDIX A n MORE ADVANCED FEATURES 251 n
APPENDIX A n MORE ADVANCED FEATURES 251 n MORE ADVANCED FEATURES 251 Invoking Stored Procedures Data outlives application logic. This is a general rule of thumb, and as we can attest, it holds true in practice. The natural lifespan of a database will tend to see multiple applications. The lifespan of some of these applications will, in turn, tend to overlap, so that at any one time we expect substantially different code bases to be accessing the same data. To resolve such issues, databases usually provide their own programming language to allow complex business rules to be expressed and enforced within the boundary of the database itself. These languages are expressed in stored procedures essentially an API to the database. Often, free-form SQL access to such a database is denied, and only access through stored procedures is permitted. Barring errors in the code of the stored procedures themselves, this removes any risk of corruption. One final advantage of using stored procedures is that when a substantial calculation is required, the use of a stored procedure can reduce the network traffic involved. For example, if you invoke a stored procedure to calculate the grand total of a table of accounts, only the request and the result figure would need to traverse the network. The equivalent client-side implementation would need to acquire the value to be totaled from every row! Taking the client example from the Putting SQL into a Mapping section, we could replace the SQL logic in the
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.