I am trying to create my first database connection on my local Tomcat server on a Windows workstation. I have a local Access 2000 database on this workstation that I want to start with. The below gives me a bunch of error messages and also I dont see where I can declare the datasource name?
Please advise what I need to modify or do to get this to work??
Please advise what I need to modify or do to get this to work??
Code:
<%@ page import="java.sql.*" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
<% Connection connection = DriverManager.getConnection("jdbc:odbc:data", "", "");
Statement statement = connection.createStatement();
ResultSet resultset= statement.executeQuery("select * from mytable"); %>
<br>
<% while(resultset.next())
{ %>
Data output:
<%= resultset.getString(1) %>
<% } %>
</body>
</html>