plz tell me how to solve problem

Reply

Join Date: Feb 2007
Posts: 18
Reputation: aruna_k_2006 is an unknown quantity at this point 
Solved Threads: 0
aruna_k_2006's Avatar
aruna_k_2006 aruna_k_2006 is offline Offline
Newbie Poster

plz tell me how to solve problem

 
0
  #1
Feb 17th, 2007
i am using tomcat 5.5,but i am unable to connect to database
<HTML>
<HEAD>
<TITLE> </TITLE>
</HEAD>
<BODY bgcolor="#8D9BCA" text="#333300" marginheight="0" marginwidth="0">
<center>
<!-- row 2 -->
<table height="1" width="381">
<td height="1" width="373">
<P align="center">&nbsp;
<P align="center">&nbsp;
<p align="center"><span style="letter-spacing: 1pt"><b><font size="3" face="Bookman Old Style">Login
Form for Clients</font></b></span></p>
<p align="center">&nbsp;</p>
<form action="clientcheck.jsp" method="POST">
<div align="center">
<table border="0" width="50%" cellspacing="5" cellpadding="5" height="80">
<tr>
<td width="33%" align="center" height="25">
<p align="center"><font size="3" face="Bookman Old Style">Client ID&nbsp;</font></p>
</td>
<td width="33%" height="25">
<p align="center"><font size="3" face="Bookman Old Style"><input type="text" name="client_id" size="20"></font></p>
</td </tr>


<tr>
<td width="33%" align="center" height="23">
<p align="center"><font size="3" face="Bookman Old Style">Password&nbsp;</font></p>
</td>
<td width="33%" height="23">
<p align="center"><font size="3" face="Bookman Old Style"><input type="password" name="client_password" size="20"></font></p>
</td>
</tr>
</table>
</div>

<p align="center"><font size="3" face="Bookman Old Style">&nbsp;&nbsp;&nbsp;&nbsp;
If new user&nbsp;&nbsp;&nbsp; <a href="registration_form.htm">Sign
up</a></font></p>

<p align="center"><b><font color="#008000" size="3" face="Bookman Old Style">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value=" Go " name="submit"></span>&nbsp;
<input type="reset" value="Reset" name="reset">
</span>
</font></b></p>
<p align="center">&nbsp;</p>

<p align="center">&nbsp;</p>
</form>
</td>
</table>
</center>
</BODY>
</html>


clientcheck.jsp

<%@ page import="java.sql.*" %>
<html>
<BODY bgcolor="#8D9BCA" text="#333300" marginheight="0" marginwidth="0">
<%
//Context ctx=null;
ResultSet rs;
Connection con;
Statement st;
String clientid;
String password;
int arraylen;



clientid=request.getParameter("client_id");
password=request.getParameter("client_password");

try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:Nikki","","");
st = con.createStatement();
rs=st.executeQuery("select * from clientlogin ");
//rs = st.getResultSet();

while(rs.next()){
String clientid1= rs.getString("client_id");
String pwd1=rs.getString("password");

if((clientid.equals(clientid1))&&(password.equals(pwd1)))
{

session.setAttribute("CLIENT_ID",clientid);

out.println(clientid);

}
}

}
catch(Exception e)
{
out.println(e.toString());
}
%>
</body>
</html>
i created dsn name correctly.After i open browser http://localhost:8080/login/clientlogin.html
it is excuted & sent to next page but i am getting error
SQL EXCEPTION:GeneralError

for tomcat do i need to install jsdk and do i need to create war file plz tell me how to create war file .
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,522
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 521
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: plz tell me how to solve problem

 
0
  #2
Feb 17th, 2007
Please don't abuse power and beauty of JAVA, scriplets are no place for setting connection to database. Use servlet...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,473
Reputation: jwenting is a name known to all jwenting is a name known to all jwenting is a name known to all jwenting is a name known to all jwenting is a name known to all jwenting is a name known to all 
Solved Threads: 235
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: plz tell me how to solve problem

 
0
  #3
Feb 17th, 2007
and don't use the bridgedriver.
42
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 18
Reputation: aruna_k_2006 is an unknown quantity at this point 
Solved Threads: 0
aruna_k_2006's Avatar
aruna_k_2006 aruna_k_2006 is offline Offline
Newbie Poster

Re: plz tell me how to solve problem

 
0
  #4
Feb 19th, 2007
thank u 4 ur suggestions.i will write in servlet
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1560 | Replies: 3
Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC