can not find symbol

Discussion in 'Software' started by ravi503, Mar 12, 2008.

  1. ravi503

    ravi503

    Joined:
    Mar 12, 2008
    Messages:
    1
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class AgencyServlet extends HttpServlet{
    Connection conn;
    private ServletConfig config;

    public void init(ServletConfig config) throws ServletException{
    this.config=config;
    }

    public void service (HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{


    String url="jdbc:mysql://192.168.0.2/balaji";
    conn=null;
    ResultSet rs=null;
    HttpSession session=request.getSession(true);
    response.setContentTyper("text/html");
    Printwriter out=response.getwriter();

    String ag_name =request.getparameter("Agency Name");
    String ag_add1 =request.getparameter("Agency Address1");
    String ag_add2 =request.getparameter("Agency Address2");
    String ag_city =request.getparameter("Agency City");
    String ag_tel =request.getparameter("Telephone");
    String regd_no =request.getparameter("Regd.No");


    try{
    Class.forName("org.gjt.mm.mysql.Driver");
    conn=DriverManager.getConnecton(url,"root","admin");
    String sql="insert into stock values(?,?,?,?,?,?)";
    PreparedStatement pst=conn.prepareStatement(sql);

    pst.setString(1,ag_name);
    pst.setString(2,ag_add1);
    pst.setString(3,ag_add2);
    pst.setString(4,ag_city);
    pst.setString(5,ag_tel);
    pst.setString(6,regd_no);

    int numRowsChanged=pst.executeUpdate();
    pst.close();
    if(numRowsChanged>=0)
    request.getRequestDispatcher("/saverecord.jsp").forward(request,response);
    else
    request.getRequestDispatcher("savefailure.jsp").forward(request,response);
    }
    catch(SQLException e){
    out.println("SQLException caught: " + e.getMessage());
    }
    catch (Exception e){
    out.println(e);
    }
    finally{
    try{
    if(rs!=null){
    rs.close();
    rs=null;
    }
    if(pst!=null){
    pst.close();
    pst=null;
    }
    if(conn!=null){
    conn.close();
    conn=null;
    }
    }//try
    catch(SqlException e)///-------------cannot find symbol
    ^
    {
    }//catch
    }//finally
    }//method
    }//class
    ravi503, Mar 12, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dennis Capulong

    Symbol PDT8146 + 3Com 3CRGPOE10075

    Dennis Capulong, Oct 14, 2005, in forum: Wireless Networking
    Replies:
    0
    Views:
    709
    Dennis Capulong
    Oct 14, 2005
  2. Nuke

    Wierd symbol in Thunderbird

    Nuke, Nov 19, 2004, in forum: Firefox
    Replies:
    0
    Views:
    585
  3. Emrys Davies

    Response symbol does not show

    Emrys Davies, Feb 24, 2004, in forum: Computer Support
    Replies:
    6
    Views:
    450
    Emrys Davies
    Feb 24, 2004
  4. callejachris@tpg.com.au
    Replies:
    2
    Views:
    657
    James
    Dec 4, 2005
  5. ianley

    @ symbol not working

    ianley, Aug 19, 2009, in forum: Computer Support
    Replies:
    0
    Views:
    337
    ianley
    Aug 19, 2009
Loading...

Share This Page