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

x
?
Solved

Problem calling a stored procedure updating database

Posted on 2005-05-11
3
Medium Priority
?
1,375 Views
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



      net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:207)
      com.actimize.infrastructure.authentication.ACMSecurityEnforcementFilter.doFilter(ACMSecurityEnforcementFilter.java:67)
      net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:105)
      net.sf.acegisecurity.ui.AbstractIntegrationFilter.doFilter(AbstractIntegrationFilter.java:170)
      net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:368)
      net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:105)


How do I make the type compatible?  

This is urgent, please help!!!

0
Comment
Question by:rdong
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
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();
0
 

Author Comment

by:rdong
ID: 13982955
Thanks ojbects. I missed that...
0
 
LVL 92

Expert Comment

by:objects
ID: 13982971
:)
0

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