JSP and Stored Procedure

  • I've looked all over for some help on this and can't find anything useful. I am building a web application using JSP with a SQL Server 2005 DB. I've created a stored procedure on the SQL server called "usp_q_IDnumberSearch". Here is the SP:

    @IDnumber varchar(10),

    @RowStart varchar(10),

    @RowEnd varchar(10)

    AS

    BEGIN

    SET NOCOUNT ON;

    WITH PagingRecords

    AS

    (

    SELECT IDnumber, last_name, first_name,date_of_birth,cob, coc, ROW_NUMBER() OVER(ORDER BY last_name) AS RowNumber

    FROM dbo.PERSON

    Where a_number=@Anumber

    )

    SELECT IDnumber, last_name, first_name,date_of_birth,cob, coc

    FROM PagingRecords

    WHERE RowNumber BETWEEN @RowStart AND @RowEnd

    END

    Now, I need the JSP application to run this SP passing the parameters @IDnumber, @RowStart, @RowEnd and display the results in the application. I also need the Next button and Back button on the results page to update the RowStart and RowEnd parameters. Do I need a Set statement?

    Does anyone know how to do this in JSP? It seems to me that it should be easy, but all of the information I come across is for ASP.

  • Hi shane,

    Im not an expert or so, but for the answer your looking, this is not the correct forum, u should try posting this on a Java or general programming Forum, if ur problem were inside the Procedure that ur using then ppl here would help really fast.

    Is just a recommendation.

    Maybe u can get something useful here http://www.java2s.com

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply