Hi,
I'm trying to query an AS/400 using a Java servlet containing the code below. Unfortunately I keep getting the error "FOR UPDATE CLAUSE NOT VALID" - I can't see where I'm going wrong though. . . Can anyone help?
I'm trying to query an AS/400 using a Java servlet containing the code below. Unfortunately I keep getting the error "FOR UPDATE CLAUSE NOT VALID" - I can't see where I'm going wrong though. . . Can anyone help?
Code:
Connection connection = null;
Statement stmt = null;
ResultSet rs = null;
try
{
connection = MrcUtils.getDataSource().getConnection();
stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery("SELECT ZTUSER, ZTITNO, ZTROUT FROM MRCDEV.ZTROLINE INNER JOIN MVXCDTA300.MITATP ON ZTITNO=MAITNO AND ZTRWHS=MAWHLO WHERE ZTUSER='"+user+"' AND MAAVTP>0 AND ZTRWHS='110' AND MAPLDT=0 FOR UPDATE OF ZTROUT" ); // Get P and A items that are in stock for the current user
while ( rs.next() )
{
rs.updateString("ZTROUT", route);
rs.updateRow();
}
}
catch( SQLException sqle )
{
throw new RuntimeException( "ProcessOrder.updateLines():" + sqle );
}
//finally { MrcUtils.cleanup( rs, connection ); }
}