Hi i new to develop wes app in JSP I am here using the access database. I have configured the .mdb datasource for the web app. When i am trying to access database i am getting the error java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
When enter my username and password the submit the form , This time it generates the error.
AdminLogin.jsp
<form name="Login" method=get action="AdminLoginRes.jsp">
username :- <input type="text" name="T1" size="24">
Password :- <input type="password" name="T2" size="23">
<input type="submit" value="Submit" name="B1">
AdminLoginRes.jsp
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%!
String un ="";
String pw = "";
int count = 1;
un = request.getParameter("T1");
pw = request.getParameter("T2");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Stock");
Statement st = con.createStatement();
ResultSet rs =st.executeQuery("SELECT * FROM Admin");
while(rs.next())
{
if(un.equals(rs.getString(1)) && pw.equals(rs.getString(2)))
{
count = 0;
break;
}
else
count = 1;
}
if (count == 0)
{
response.sendRedirect("AdminView.jsp?un="+un+"&pass="+pw);
}
else
{
response.sendRedirect("AdminLogin.jsp?er=Invalid Username or Password! Try Again... ");
}
}
catch(Exception e)
{
out.println(e);
}
%>
Can you please findout where i am doing wrong ?