Wrox Programmer Forums
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 24th, 2004, 12:31 PM
Authorized User
 
Join Date: Oct 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem

hi,

i have used following prepared Statement for the update in database.

Can any one tell me that,How can i use date in following method.

I have 4 field for date as given below:(BOLD shown)

I have used String in that place.

It is not working.




PreparedStatement pstatement = conn.prepareStatement(
"UPDATE sec_mast SET catg_code=?, vou_no=?, vou_date=?, vou_amt=?, due_date1=?, due_date2=?, mat_date=? where sec_no=? ");

pstatement.setInt(1,Integer.parseInt(request.getPa rameter("catg_code")));
pstatement.setString(2,request.getParameter("vou_n o"));
pstatement.setString(3,request.getParameter("vou_d ate"));
pstatement.setInt(4,Integer.parseInt(request.getPa rameter("vou_amt")));
pstatement.setString(5,request.getParameter("due_d ate1"));
pstatement.setString(6,request.getParameter("due_d ate2"));
pstatement.setString(7,request.getParameter("mat_d ate"));
pstatement.setInt(8,Integer.parseInt(request.getPa rameter("sec_no")));


int rowCount = pstatement.executeUpdate();
conn.setAutoCommit(false);
conn.setAutoCommit(true);
}

plz help me










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.