Hi GURUs !
i am trying to establish servelt database connectivity with jdbc, and everytime i am getting different exceptions.
I hope you ,Guru's, can help me with that :)
first of all i am using tomcat 3.2.2 , jdk 1.3. microsoft access as a database , EAsysoft's jdbc odbc drivers.
It can find the driver classes ,because it stopped throwing ClassNOTfound exceptions .
Another strange thing my servlet can compile, but when i access it with browser ( IE 5) , it throws
SQLException[JOB] Connection failed String index out of range: -19
exception.
Please someone help me with this,
or i will get crazy :(
Thanks  a lot for taking time
sincerely :)
 
here is a snippet of my simple code :
 
public class qw extends HttpServlet {
 
  static final String select =
    "SELECT * FROM chat";
 
  static final String insert =
    "INSERT INTO chat (name, subject, message) " +
    "VALUES (?, ?, ?)";
   public void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException,IOException {
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
res.setContentType("text/html");
PrintWriter pw= res.getWriter();
   try {
Class.forName("easysoft.sql.jobDriver");
 
con=DriverManager.getConnection("jdbc:easysoft:db1");
 
pw.println("sukur");
} catch (ClassNotFoundException nf){pw.println("ClassNotFoundException "); }
catch (SQLException se) {pw.println("SQLException"+se.getMessage()); }
finally {
try {
if(con!=null){ con.close();}
}catch (SQLException ig) {pw.println("SQLException ignored");}
}
}
}

Reply via email to