主题:jsp连接access数据库的问题,麻烦各位高手看完
运行后出现如下错误:
��ݿ����Ӵ��󣡣�������Ϣ���£�
[Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
源代码为 请各位高手指点<%@page contentType="text/html" pageEncoding="utf-8" language="java" import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
try {
String spath = "jl_access";
String dbpath = application.getRealPath(spath);
String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb,*.accdb)};DBQ=" + dbpath;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
String sql = "select * from jl1";
ResultSet rs = stmt.executeQuery(sql);
��ݿ����Ӵ��󣡣�������Ϣ���£�
[Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
源代码为 请各位高手指点<%@page contentType="text/html" pageEncoding="utf-8" language="java" import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%
try {
String spath = "jl_access";
String dbpath = application.getRealPath(spath);
String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb,*.accdb)};DBQ=" + dbpath;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection(url);
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
String sql = "select * from jl1";
ResultSet rs = stmt.executeQuery(sql);