Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1133
  • Last Modified:

Cursor State Not Valid

I am using the following result set and prepared statement.  The update query works, but the a "CURSOR STATE NOT VALID"
exception occurs and the rest of my code is ignore. Thanks in advance to anyone that can help.

String updateDb2Query = "UPDATE tstdtatst.A767040A set ORCPDT = '"+bReqCompDate+"', ORFL = '"+flag+"', ORACTN = '"+action+"', ORFIH = "+frontInsideHeight+",ORRIH = "+rearInsideHeight+",ORFLRT="+floorRate+",ORLNID="+lineSplit+", ORDATE='yyyy-mm-dd',ORGDTE='yyyy-mm-dd', ORTPRC="+bTotal+", ORTCST="+bTotalCost+", ORTMRG="+bTotalMargin+", ORQTY="+bTotalQty+",ORMODL='"+bModel+"',ORCO='"+bPlant+"',ORSLSF='"+salesfname+"', ORSLSL='"+saleslname+"', ORCUST="+customerJdeNum+", ORPRCD='"+productCode+"',ORDAUT='"+discountNumber+"',ORUSER='"+salesmanId+"' where ORGORN = "+oracleId+"";
pUpdateDb2Query = db2.prepareStatement(updateDb2Query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
rsUpdateDb2Query = pUpdateDb2Query.executeQuery();
rsUpdateDb2Query.close();  pUpdateDb2Query.close();
0
gdlp2004
Asked:
gdlp2004
1 Solution
 
gdlp2004Author Commented:
I found the answer...you need to replace rsUpdateDb2Query = pUpdateDb2Query.executeQuery(); with .executeUpdate();
0
 
CetusMODCommented:
Closed, 500 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now