tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: doubt
Date Tue, 15 May 2001 11:05:19 GMT

	There is only one line in your program that is causing it to crash.
That is:
> 	     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
(copied from your program listing below).  If you were to look at Sun's Bug
Parade for the ODBC Bridge you would find that there are about 4 bugs
reporting that concurrent access to ODBC data sources causes an application
to GPF/Dr Watson/crash.  Sun's response has consistently been that the ODBC
Bridge is an experimental proof of concept and is unsupported.  Consequently
this bug will not be fixed.  Their advice (and that of all other developers
who know of this) is to use a real JDBC driver.  There are commercial grade
drivers for ODBC and almost every other database in active use and
development.

	Randy

> -----Original Message-----
> From: khan uruj [mailto:uruj_a@yahoo.com]
> Sent: Tuesday, May 15, 2001 3:45 AM
> To: tomcat-user@jakarta.apache.org
> Subject: doubt
> 
> 
> hello,
> 
>        I am using jakarta-tomcat-3.2 with apache
> 1.3.12.while running my program with html and servlet
> it is generating  an error log dialog box and tomcat
> is getting shutdown automatically.while registering a
> new user ,it is working fine(which is commented in
> program ) but when i am validating for user ,it is
> working fine but after getting the result it is
> generating an error log dialog box and tomcat is
> getting terminated .i am sending the full program and
> attaching the error log dialog box with it.any
> suggestions in this regard will be appreciated.
> uruj							
> 
> 
> package com.bodhtree.espeak.BT3C.login;
> //java Io Classes
> import java.io.PrintWriter;
> import java.io.IOException;
> 
> //java util Classes
> import java.util.Hashtable;
> import java.util.Enumeration;
> 
> //javax http Classes
> import javax.servlet.http.HttpSession;
> import javax.servlet.ServletException;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import java.sql.*;
> 
> public class ValidationServlet extends HttpServlet
> {
> 
>  public void service(HttpServletRequest
> req,HttpServletResponse res) throws
>   								
> 								
> 	IOException
>  {
> 
> 	 PrintWriter out=res.getWriter();
> 	 HttpSession mysession = req.getSession(true);
> 	 String username= req.getParameter("username");
> 	 System.out.println(username);
> 	 String password= req.getParameter("password");
> 	 System.out.println(password);
> 	 String nickname= req.getParameter("nickname");
> 	 System.out.println(nickname);
> 	 if(nickname==null)
> 	 {
> 
> 	   try
> 	   {
> 	     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> 	     Connection con =
> DriverManager.getConnection("jdbc:odbc:3C");
> 	     System.out.println("Connected to database");
> 	     PreparedStatement psq =
> con.prepareStatement("SELECT username FROM usertable
> WHERE password='"+password+"'");
> 	     System.out.println("after preparedStatement");
> 	     ResultSet rs = psq.executeQuery();
> 	     System.out.println("############### The
> Resultset is ##############"+rs);
> 	     if(rs.next()==false)
> 	     {
> 	       con.close();
> 	       System.out.println("Before closing the
> connection");
> 	  	  
> res.sendRedirect("/bt3c/UserRegistration.html");
> 	     }
> 	     else
> 	     {
> 		   String user=rs.getString("username");
> 		   mysession.putValue("username",username);
> 		   String
> str=(String)mysession.getValue("username");
> 		   System.out.println("Has put the value into the
> session"+user);
> 	       con.close();
> 	       res.sendRedirect("/bt3c/CommunityHtml.html");
> 	     }
> 	   }// END OF try BLOCK
> 	   catch(Exception e)
> 	   {
> 	     e.printStackTrace();
> 	   }
>     }
>     /*try
>     {
> 	  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> 	  Connection cons =
> DriverManager.getConnection("jdbc:odbc:3C");
> 	  System.out.println("Connected to database");
> 	  String sql= "INSERT INTO
> usertable(username,password,nickname) VALUES (?,?,?)";
> 	  PreparedStatement prst =
> cons.prepareStatement(sql);
> 	  prst.setString(1,username);
> 	  prst.setString(2,password);
> 	  prst.setString(3,nickname);
> 	  prst.executeUpdate();
> 	  System.out.println("Inserted values");
> 	  cons.close();
> 	  System.out.println("Connection closed");
> 	  mysession.putValue("username",username);
> 
>     }catch(Exception e)
>     {
> 	  e.printStackTrace();
>     }*/
>   }
> }
> 
> 
>  
> 
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> 

Mime
View raw message