<x:nextRow>
A x:nextRow action is used to position to the next row in a result set produced by a x:select or x:procedureCall action. Any rows in result sets produced by those actions are cached in memory on the application server. One row in a result set is considered to be the current one. By default, the actions x:getColumn, x:update, x:delete, and x:insert operate with respect to the current row. Immediately after an x:select or x:procedureCall action, you are automatically positioned to the first row, if there is one. Using this action would move you to the second one. (Likewise, when you first move to another result set, you are automatically positioned to its first row.)
This action provides relative movement among rows. To move to an absolute row number, use the jsp:setProperty action to set the currentRow property of the DBSelect or DBProcedureCall bean.
This action does not establish a connection to the database. If any column values have been changed in the current row using the x:setColumn action or using a scriptlet, the DBSelect bean will attempt to update the row before moving. In most cases there will be no active database connection, and the attempt will fail. (There could be an active database connection if the x:nextRow occurs inside an x:batch, or if a connection has been established in a scriptlet.) The proper procedure if you have set any column values is to do x:updateRow before doing x:nextRow.
Syntax
<x:nextRow name = "target bean name" />The x:nextRow action has the following attributes:
- name
- The name of the DBSelect or DBProcedureCall bean. The value is case sensitive and must match a Select or ProcedureCall action that is in scope. This attribute is required unless the action is (directly or indirectly) inside the body of an x:repeat for which the name attribute has been specified. In that case, the name attribute defaults to the same value specified in the closest containing x:repeat.