Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 29th, 2004, 06:37 AM
Authorized User
Join Date: Oct 2004
Location: , , .
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default prob.. confirm message


its the updation query.In this page when i click the update button it updates the values in the row..and this query is working...

I want to do that..when i click a update button it gives me a confirms message whether did u want to update the row and also displaying the particular gl_code no in that confirms message.when i click on yes it updates the row..otherwise it doesnot.

after updation it shows message that this particular gl_code no is has been updated.

String action = request.getParameter("action");

if (action != null && action.equals("update")) {

PreparedStatement pstatement = conn.prepareStatement(
"UPDATE gl_mast SET gl_descr = ?, db_amt = ?, " +
"cr_amt = ?, gl_type = ? , gl_pct = ? WHERE gl_code=?");

pstatement.setString(1, request.getParameter("gl_descr"));
pstatement.setFloat(2,Float.parseFloat(request.get Parameter("db_amt")));
pstatement.setFloat(3,Float.parseFloat(request.get Parameter("cr_amt")));
pstatement.setString(4, request.getParameter("gl_type"));
pstatement.setFloat(5,Float.parseFloat(request.get Parameter("gl_pct")));
pstatement.setInt(6,Integer.parseInt(request.getPa rameter("gl_code")));

int rowCount = pstatement.executeUpdate();



Statement statement = conn.createStatement();

ResultSet rs = statement.executeQuery
("SELECT * FROM gl_mast ");


<form action="gl_update.jsp" method="get">
<input type="hidden" value="update" name="action">
<td><input value="<%= rs.getInt("gl_code") %>" size="5" name="gl_code"></td>
<td><input value="<%= rs.getString("gl_descr") %>" size="55" name="gl_descr"></td>
<td><input value="<%= rs.getFloat("db_amt") %>" size="12" name="db_amt"></td>
<td><input value="<%= rs.getFloat("cr_amt") %>" size="12" name="cr_amt"></td>
<td><input value="<%= rs.getString("gl_type") %>" size="3" name="gl_type"></td>
<td><input value="<%= rs.getFloat("gl_pct") %>"size="5" name="gl_pct"></td>
<td><input type="submit" value="Update"></td>

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Confirm in ItemDataBound rstelma ASP.NET 1.0 and 1.1 Basics 3 December 6th, 2006 02:10 AM
Javascript Confirm Message box itHighway Javascript How-To 5 September 25th, 2006 02:51 AM
Confirm messagebox edwin.debrouwere ASP.NET 2.0 Basics 0 September 5th, 2006 07:29 AM
confirm crmpicco Javascript How-To 2 February 7th, 2005 01:23 PM
HTML Confirm VSnewbie Javascript How-To 3 August 30th, 2004 10:36 AM

All times are GMT -4. The time now is 07:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.