GeeCON Prague 2014*
The moose likes Servlets and the fly likes please any one cleare my error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark "please any one cleare my error" Watch "please any one cleare my error" New topic

please any one cleare my error

suresh kalaimani

Joined: Aug 15, 2009
Posts: 1
import java.sql.*;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Invoice extends HttpServlet {

protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException , IOException {

PrintWriter out = res.getWriter();

String partyname = req.getParameter("s1");
String ExporterName = req.getParameter("s2");
String Billno =req.getParameter("s3");
String invoiceno =req.getParameter("s5");
String certificate =req.getParameter("s7");
String cityportloading =req.getParameter("s9");
String cityportdischarge =req.getParameter("s10");

String Description =req.getParameter("s11");
//String particulars =req.getParameter("");
//String billingcharge =req.getParameter("");
String total =req.getParameter("s12");
String amount =req.getParameter("s13");
String amountchangeableinwords = req.getParameter("s14");
String Billnodated = req.getParameter("s4");
String invoicedated = req.getParameter("s6");
String certificatenodated = req.getParameter("s8");

Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/master","root","");
PreparedStatement ps = connection.prepareStatement("insert into invoice values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setInt(3, Integer.parseInt(Billno));
ps.setInt(4, Integer.parseInt(invoiceno));

//ps.setInt(10, Integer.parseInt(billingcharge));
ps.setInt(11, Integer.parseInt(total));
ps.setInt(12, Integer.parseInt(amount));
ps.setInt(14, Integer.parseInt(Billnodated));
ps.setInt(15, Integer.parseInt(invoicedated));
ps.setInt(17, Integer.parseInt(certificatenodated));
int s = ps.executeUpdate();
if(s > 0){
out.println("<h2>Values inserted into table.....</h2>");
} else {
out.println("<h2>Not Inserted.....</h2>");

}catch (SQLException sqe) {
}catch (ClassNotFoundException cne) {



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">

<Title> Invoice </Title>
<Body background="Back.jpg">
<form name="sample" action="invoice" method="post">
<table border="1" width="100%">
<td><img src="C:/WebProject_workspace/My_FirstProject/WebContent/images/jj.jpg"></img></td> <td ><font color="blue" size="10"> INVOICE</font></td>
<Table align="left" border="1" cellspacing="10" cellpadding="10">
<td> Party Name</td><td><input type="text" name="s1"></td>
<td> Exporter Name</td><td><input type="text" name="s2"></td>
<table align="center" border="1">
<td>Bill No:</td><td><input type="text" name="s3"></td><td>BillnoDated:</td><td><input type="text" name="s4"></td>
<td>Invoice No:</td><td><input type="text" name="s5"></td><td>InvoiceDated:</td><td><input type="text" name="s6"></td>
<td>Certificate:</td><td><input type="text" name="s7"></td><td>CertificateDated:</td><td><input type="text" name="s8"></td>
<td>City/Port Loading:</td><td><input type="text" name="s9"></td><td>City/Port Discharge:</td><td><input type="text" name="s10"></td>
<td>Description:</td><td><textarea name="s11 "></textarea></td>
<table Border="1">
<tr> <td>
<table Border="1" align="left" width="400">
<td>Billing Charge</td>
<table align="" border="1" width="150">
<td><input type="text" name="s12"></td>
<td><input type="text" name="s13"></td>


<table Border="1">
<td> Amount Changeable in Words:</td>
<tr> <td><textarea name="s14"></textarea></td>
<table Border="0" align="right">
<td>For FUMITECT Services</td>
<tr> <td>      </td>
<tr> <td>Authorised Signatory</td>

<input type="submit" name="n3" value="ok">
<input type="Reset" name="n3" value="cancel">




<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">



chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
What is the error message you are facing?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 61298

A couple of things:

Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.

And, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

A title such as "please any one cleare my error" is not helpful. What would happen if all posts had such a title?

Please go back and change your post to add a more meaningful subject by clicking the button on your post.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sai Kiran nukala

Joined: Aug 16, 2009
Posts: 9

Hi suresh can you specify the error....???
GeeCON Prague 2014
subject: please any one cleare my error