Problem calling a stored procedure updating database

Posted on 2005-05-11
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\ 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
    LVL 92

    Accepted Solution

    > rs = cs.executeUpdate()

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

    int nrows = cs.executeUpdate();

    Author Comment

    Thanks ojbects. I missed that...
    LVL 92

    Expert Comment


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    squareUp  challenge 22 81
    mergeTwo  challenge 13 53
    array6 challenfge 6 48
    firstChar challenge 13 57
    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…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    734 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

    24 Experts available now in Live!

    Get 1:1 Help Now