Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem calling a stored procedure updating database

Posted on 2005-05-11
Medium Priority
Last Modified: 2012-08-13
I am new to calling stored procedure using jdbc. If you know both Java JDBC and stored procedure,  please help.

The following  is the code in a JSP program I use to call a stored procedure  which resides in MS SQL 2000

CallableStatement cs = con.prepareCall("{call sp_update_eft_thresholds '750000000926140US','Test User100','100.00','10','200.00','2','300.00','3','400.00','4'}");

rs = cs.executeUpdate()

I also tried  :

sp="sp_update_eft_thresholds '750000000926140US','Test User100','100.00','10','200.00','2','300.00','3','400.00','4'";

rs = stm.executeUpdate(sp);

This is the error I got:

C:\Tomcat5.0\work\Catalina\localhost\acm\org\apache\jsp\EditThreshold_jsp.java:652: incompatible types
found   : int
required: java.sql.ResultSet
                         rs = cs.executeUpdate();         
1 error


How do I make the type compatible?  

This is urgent, please help!!!

Question by:rdong
  • 2
LVL 92

Accepted Solution

objects earned 200 total points
ID: 13982873
> rs = cs.executeUpdate()

updates do nit return a result set, it returns no rows affected

int nrows = cs.executeUpdate();

Author Comment

ID: 13982955
Thanks ojbects. I missed that...
LVL 92

Expert Comment

ID: 13982971

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

577 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