Login page in jsp -------------- <%@ page language ="java" import="java.sql.*" %>
Make your own free website on Tripod.com
User Name
Password
LogIn">
<% String user=request.getParameter("t1"); String pass=request.getParameter("t2"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:mydsn", "jp", "jp"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select username,password from userlog"); while(rs.next()) { String username=rs.getString(1); String password=rs.getString(2); if(user.equals(username) && pass.equals(password)) { %> <%} else out.println("Login Failed,Please try Againe"); %> <% } }catch(Exception e1) {} %> ================ LoginSuccess.jsp ----- U sucessfuly Entered