JSP please tell me what I'm doing wrong.

This is a discussion on JSP please tell me what I'm doing wrong. within the Javascript forums in Programming Languages category; I know that technically this isn't the place for JSP but, I'm trying to implement a simple login system. Its running in JBuilder and connecting to an oracle database. But isn't working. I'm almost certain this code is correct. What the hell is wrong!? <%@ page language ="java" import="java.sql.*,oracle.jdbc.*" %> <html> <body bgcolor="pink"> <form name="f1" method="post"> <table> <tr> <td>User Name</td><td><input type="text" name="t1" ></td> </tr> <td>Password</td> <td><input type=""password"" name="t2"></td> </tr> <tr> <td></td> <td><input type="submit" name="b1" value="Log In"></td> </tr> </table> <% String user=request.getParameter("t1"); String pass=request.getParameter("t2"); try{ Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection("jdbc racle:thin: @witnt07.wit.ie:1521 rawit","25CSD03", "25CSD03"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select username,password from superdetails"); while(rs.next()) { ...

Go Back   Application Development Forum > Programming Languages > Javascript

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 02-26-2004, 11:19 AM
Ray Godfrey
Guest
 
Default JSP please tell me what I'm doing wrong.

I know that technically this isn't the place for JSP but,

I'm trying to implement a simple login system. Its running in JBuilder
and connecting to an oracle database. But isn't working. I'm almost
certain this code is correct. What the hell is wrong!?


<%@ page language ="java" import="java.sql.*,oracle.jdbc.*" %>
<html>
<body bgcolor="pink">
<form name="f1" method="post">
<table>
<tr>
<td>User Name</td><td><input type="text" name="t1" ></td>
</tr>
<td>Password</td>
<td><input type=""password"" name="t2"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="b1" value="Log In"></td>
</tr>
</table>
<%
String user=request.getParameter("t1");
String pass=request.getParameter("t2");

try{

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbcracle:thin: @witnt07.wit.ie:1521rawit","25CSD03",
"25CSD03");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select username,password from
superdetails");
while(rs.next())
{
String username=rs.getString(1);
String password=rs.getString(2);
if(user.equals(username) && pass.equals(password))
{
%>
<jsp:forward page="Jsp1.jsp"/>
<%}
else
out.println("Login Failed,Please try Again");
%>

<%
}
}catch(Exception e1)
{}

%>

</form>
</body>
</html>



Regards,
Ray Godfrey
Reply With Quote
  #2  
Old 02-27-2004, 06:59 AM
Erwin Moller
Guest
 
Default Re: JSP please tell me what I'm doing wrong.

Which error/problem do you have?
Is it rejecting all username passwords?
Is the databaseconnection failing?
Is the forward failing?

Erwin Moller
Reply With Quote
  #3  
Old 03-01-2004, 07:18 AM
Ray Godfrey
Guest
 
Default Re: JSP please tell me what I'm doing wrong.

Erwin Moller <since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote in message news:<403f3105$0$574$e4fe514c@news.xs4all.nl>...
> Which error/problem do you have?
> Is it rejecting all username passwords?
> Is the databaseconnection failing?
> Is the forward failing?
>
> Erwin Moller


I'm not quiet sure. I press the "play" button, the text boxes clear
and in the what i think is calld "viewer pane" the userneme and
password apeear then nothing. Its rather frustrating. To test the code
i tred putting a print statement in there somewhere but nothing
happened.

Cheers for replying anyway.

Ray
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:24 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.