hi
i am working on servlets which is calling stored procedure
from database.
I have written a servlet which generates the screen and user
will enter some text in some fields and selects some options from
select boxes.If he clicks the ADD button it will invoke another servlet
where in i have written the connection and CallableStatement and passed the
parameters to stored procedure.
I am getting all the parameters(8) from the screen and passing to
the stored procedure as follows:
String concode=req.getParameter("configcode");
String descr=req.getParameter("desc");
String startday=req.getParameter("day");
String Startmonth=req.getParameter("month");
String Startyear=req.getParameter("year");
String StartDate=startday+"-"+Startmonth+"-"+Startyear;
(i am getting day,month,year from dropdown list, so i am
concatinating them)
String endday=req.getParameter("day1");
String endmonth=req.getParameter("month1");
String endyear=req.getParameter("year1");
String EndDate=endday+"-"+endmonth+"-"+endyear;
String amount=req.getParameter("inAmt");
value=Integer.parseInt(amount);
String classcode=req.getParameter("classselect");
String user=req.getRemoteUser();
CallableStatement callstmt=con.prepareCall("{call <storedprocedure
name>(?, ?, ?, ?, ?, ?, ?, ?)}");
callstmt.setString(1,"concode");
callstmt.setString(2, "descr");
callstmt.setString(3, "StartDate");
callstmt.setString(4, "EndDate");
callstmt.setInt(5, value);
callstmt.setString(6, "classcode");
callstmt.setString(7, "user");
callstmt.setString(8, "selectedoption");
After execution this stored procedure should update the database
i.e. the above values should be inserted into the table.
But i am not able to insert into the table .
can any one please check this code and help me finding the
solution
thank you very much for your time
BasuSurapaneni
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html