| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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()) { 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 |
|
#2
| |||
| |||
| Which error/problem do you have? Is it rejecting all username passwords? Is the databaseconnection failing? Is the forward failing? Erwin Moller |
|
#3
| |||
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.