Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > can not find symbol

Reply
Thread Tools

can not find symbol

 
 
ravi503 ravi503 is offline
Junior Member
Join Date: Mar 2008
Posts: 2
 
      03-12-2008
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").fo rward(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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Encryption Package) error: cannot find symbol symbol: class BaseNCode clusardi2k@aol.com Java 6 08-29-2012 08:33 PM
Why ":symbol" failed but 'symbol' successed with JRuby 1.0.3? Song Ma Ruby 2 07-20-2008 04:08 AM
can nit find symbol ravi503 Java 0 03-12-2008 06:43 AM
what's differnece between #ifdef symbol and #if defined(symbol) baumann@pan C Programming 1 04-15-2005 08:25 AM
perl extension promblem Can't find 'boot_<blah>' symbol in .so JNye Perl Misc 4 02-13-2005 01:41 AM



Advertisments