最近刚好有个项目要连接ACCESS的MDB数据并导入到ORACLE中,使用
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- String strurl="jdbc:odbc:driver={Microsoft Access Driver(*.mdb)};DBQ=E:\\db.mdb";
- Connection conn=DriverManager.getConnection(strurl);
时报了以下的错误 java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序,苦与网上基本上找不到原因只能上外文网找找了
经过GOOGLE后找到一个jstels连接方式http://www.csv-jdbc.com/ 这个网中有比较强大的连接csv\xml\dbf\mdb\engine的驱动,需要的同学可以上这个网上下载
这里提供mdb的连接驱动和使用说明
Installation
Add the driver jar files (mdbdriver.jar + required third-party libraries) to your classpath or extract these jars to the directory of your application.
Driver Classes
Description | Classes |
Driver class (JDBC API v1.0) | jstels.jdbc.mdb.MDBDriver2 |
Data Source class (JDBC API v2.0) | jstels.jdbc.mdb.MDBDataSource2 |
Connection Pool Data Source class (JDBC API v2.0) | jstels.jdbc.mdb.MDBConnectionPoolDataSource2 |
URL Syntax
The connection URL is jdbc:jstels:mdb:path_to_mdb_file, where path_to_mdb_fileis:
-
an absolute or relative path to a Microsoft Access database (MDB or ACCDB) file, e.g.:
jdbc:jstels:mdb:c:/mdb_directory/test.mdb
jdbc:jstels:mdb:mdb_directory/test2.mdb
jdbc:jstels:mdb:mdb_directory/access2007.accdb
-
path to a file within the CLASSPATH (read-only), e.g.:
jdbc:jstels:mdb:classpath://resources/test.mdb
-
path to a file within a ZIP (JAR) file (read-only), e.g.:
jdbc:jstels:mdb:zip://c:/dir/archive.zip/test.mdb
-
path to a file located on a FTP server (syntax: ftp://user:password@hostname[:port]/[dirpath/]mdbfile), e.g.:
jdbc:jstels:mdb:ftp://login:password@somesite.com:21/mdb_directory/test.mdb
-
SFTP URL to the SFTP-server directory (syntax: sftp://user:password@hostname[:port]/[dirpath/]mdbfile, also required third-party libraries Commons VFS and JSch for this protocol), e.g.:
jdbc:jstels:mdb:sftp://login:password@somesite.com:22/mdb_directory/test.mdb
-
HTTP URL to a file (read-only), e.g.:
jdbc:jstels:mdb:http://www.somesite.com/mdb_directory/test.mdb
-
SMB/CIFS URL to a file located on a SMB/CIFS server (e.g.: MS Windows share or Samba server, syntax: smb://[user:password@]hostname/share/[dirpath/]mdbfile):
jdbc:jstels:mdb:smb://your_server/your_share/mdb_directory/test.mdb
jdbc:jstels:mdb:smb://login:password@your_server/your_share/mdb_directory/test.mdb
PS:这个是收费的驱动, 本人已经破解。。。如需要可私信我!或者至CSDN下载:http://download.csdn.net/detail/chaico/5072327
- Access_数据库_驱动stels_mdb.zip (2.6 MB)
- 下载次数: 69
顶
踩