JSP actions for database access
WebSphere Studio provides a tag library of JSP actions for database access. The actions conform to the JSP 1.1 syntax. An x: is used in this document as the prefix for the JSP actions. The actual prefix that will appear in JSP files is user-specifiable through the taglib directive.
Actions
The actions in the library include the following:
- <x:dataSourceSpec>
- <x:driverManagerSpec>
- <x:select>
- <x:modify>
- <x:procedureCall>
- <x:sql>
- <x:parameter>
- <x:column>
- <x:updateRow>
- <x:deleteRow>
- <x:insertRow>
- <x:nextResultSet>
- <x:previousResultSet>
- <x:nextRow>
- <x:previousRow>
- <x:getColumn>
- <x:setColumn>
- <x:getParameter>
- <x:repeat>
- <x:batch>
- <x:selectRef>
- <x:procedureCallRef>
In the descriptions for these actions, assume that, in general, attribute values are not sensitive to case. Where this is not true, it will be stated. The primary reason for exceptions to this rule is when an attribute value can serve as a Java identifier.
In addition to the function of JSP tags previously provided for database access, the main functions that these actions provide include:
- Ability to execute SQL statements containing parameter markers, and to set the parameter values.
- Ability to execute stored procedures, getting any output parameter values, as well as accessing any result sets that they return.
- For any JSP SQL action that produces a result set, the ability to update or delete rows in that result set without writing a separate SQL statement to do so. Just position to the target row, make any desired value changes, and update or delete the row. You can also insert new rows into the result set without writing a separate SQL statement.
The JSP tags are built on top of a set of beans, referred to as the DB Beans, available in the package com.ibm.db.beans. The primary beans in this package are DBSelect, DBProcedureCall, and DBModify. You can use these beans directly in programs you write in addition to using them indirectly via the JSP SQL tags.