Solved

Cursor State Not Valid

Posted on 2004-09-28
2
1,087 Views
Last Modified: 2012-05-05
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
Comment
Question by:gdlp2004
2 Comments
 

Author Comment

by:gdlp2004
ID: 12172374
I found the answer...you need to replace rsUpdateDb2Query = pUpdateDb2Query.executeQuery(); with .executeUpdate();
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 12172880
Closed, 500 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
update db2 V 8.01 table but get time out error 68 33 221
Help with DB2 Create store procedure query 4 96
db2 != check 14 50
DB2 CONCAT FAILING 4 103
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now