tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dwaipayan " <babua_...@rediffmail.com>
Subject java error in database access
Date Thu, 05 Jul 2001 19:41:51 GMT

i have been facing a problem in tomcat which i could not solve may be due to being a "first
time user" . i will be pleased if u could tell me the source of this problem.
i have a login page where the user enters username and password in 2 text fields(user &
pwd).the form action leads to login.jsp file.if  both are found in the table "login" located
in Oracle8.0.4(personal edition), then the user is greeted by his username. else error msg
is shown.when i used JdbcOdbcDriver the output was as expected.but immediately after the output
page was displayed,an illegal operation msgbox was shown by java.this error does not occur
sometimes.but whenever i stop tomcat and restart it,and acces my login page the error appears
again.the error looks like the following:

[
JAVA caused an invalid page fault in
module <unknown> at 0000:08412f90.
Registers:
EAX=083105d8 CS=0177 EIP=08412f90 EFLGS=00010297
EBX=08310908 SS=017f ESP=050dfd2c EBP=050dfd4c
ECX=00000000 DS=017f ESI=08310140 FS=3ca7
EDX=08310140 ES=017f EDI=00000000 GS=0000
Bytes at CS:EIP:

Stack dump:
1f7025d1 004151d0 00000000 01950000 007b1ec0 00679470 00000000 00000000 050dfda4 1f702505
08310140 00000000 00000010 019512e8 007b1ec0 50472958 
]
my classpath has tomcat_home,java_home,and c:\jdk1.2.2\lib\tools.jar set appropriately
i am using Windows98 machine with 64mb ram,433mhz and with initial memory set to 3072(thru
dos window properties--memory tab).

i have tried in debugging by putting System.out.println() statements but to no avail.

i am enclosing the login.jsp file i used.
eagerly awaiting ur comments.

login.jsp:

<%@ page session="true" import="java.sql.*,sun.jdbc.odbc.*,java.io.*" %>


<% 
String s1=request.getParameter("user");
String s2=request.getParameter("pwd");
String upwd=null;
try{

if(s1.length()==8 &&  s2.length()==6)
{
	System.out.println("loading driver");
                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
		System.out.println("creating connection");
                Connection con=DriverManager.getConnection("jdbc:odbc:login","scott","tiger");
		System.out.println("creating statement");
               Statement stmt=con.createStatement();
	        
		System.out.println("executing query");
                ResultSet rs=stmt.executeQuery("select password from login where username='"+
s1+"'");
		System.out.println("checking if rs is null");
                if(rs!=null)
	{
				System.out.println("while rs exists");
			while(rs.next())
                			{
					System.out.println("retrieving password");
				upwd=rs.getString("password");
			}
	}
		System.out.println("closing connection");
           	con.close();
			System.out.println("checking if upwd is null"); 
		if(upwd!=null)
		{
				System.out.println("checking if upwd=s2");
			if(s2.equals(upwd))
			{
					System.out.println("if upwd=s2");
                        			out.println("Welcome Back to this site "+s1);
			}
                         
                        
                 	 		else
		 	{
	     				System.out.println("if upwd not equal to s2");
	    		            	out.println("Incorrect password");
			}
	     
                		}
	                else
           		{
				System.out.println("if upwd is null");     
                			out.println("Incorrect username ");
		}
                
                
                
                


}
else
{
		System.out.println("if entered username/password are not valid");
	out.println("Invalid no. of characters in username/password");
}
}
catch(Exception ex){System.out.println("inside catch"+ex);}
System.out.println("end of jsp");

 %>



Dwaipayan Datta Ray (call me Ray)
babua_007@rediffmail.com


____________________________________________________
Buy Feng Shui Package for Rs. 151/- only, at http://shopping.rediff.com/shopping/fengshui_mailer.htm




Mime
View raw message