"Cross-Database Portability with JDBC"
Volume: 5 Issue: 1, p.62

Listing 1: Pure JDBC Template for Positioned Update

ResultSet rset =  stmt.executeQuery("select ename from emp for update");
   String cursor = rset.getCursorName();
   PreparedStatement ps = conn.prepareStatement("update emp set ename = ? " +
                                                    "where current of ?");
   while (rset.next()) {
        String ename = rset.getString(1);
        ps.getString(1, ename.toLowerCase());
        ps.setString(2, cursor);
        ps.executeUpdate();
   }