Solved

Cursor State Not Valid

Posted on 2004-09-28
2
1,111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Driver Where can I find IBMDA400 driver software 5 3,335
db2icrt -u db2inst1 db2inst1 problem on mac 4 265
InterSystems Caché OPEN QUERY 4 547
AS400 Single Sign On 3 1,499
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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