Hi,
I am fairly new to JSP and i am trying to connect to a database (access) and i am getting the following error:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
.....
Here is my code - any suggestions would be great.
<%@page import= "java.lang.*, java.io.*, java.util.*, java.sql.*, com.beans.Login"%>
<jsp:useBean id="login" class="com.beans.Login" scope = "session" />
<jsp:setProperty name="login" property="*" />
<%=login.getUserName()%><%=login.getPassword()%>
<br>
<%
Driver drv = (Driver)
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver".newInstance();
Connection con = java.sql.DriverManager.getConnection("jdbcdbc:Test2"
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from Employee"
while ( rs.next() )
{
int eeType = rs.getInt("EmployeeType_ID"
int employeeID = rs.getInt("Employee_ID"
-- do what i need to do
}
Thanks in advance..
-Bell
I am fairly new to JSP and i am trying to connect to a database (access) and i am getting the following error:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
.....
Here is my code - any suggestions would be great.
<%@page import= "java.lang.*, java.io.*, java.util.*, java.sql.*, com.beans.Login"%>
<jsp:useBean id="login" class="com.beans.Login" scope = "session" />
<jsp:setProperty name="login" property="*" />
<%=login.getUserName()%><%=login.getPassword()%>
<br>
<%
Driver drv = (Driver)
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver".newInstance();
Connection con = java.sql.DriverManager.getConnection("jdbcdbc:Test2"
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select * from Employee"
while ( rs.next() )
{
int eeType = rs.getInt("EmployeeType_ID"
int employeeID = rs.getInt("Employee_ID"
-- do what i need to do
}
Thanks in advance..
-Bell