连接access用很多种,今天说一种我的连接方法,是用的hxtt(http://www.hxtt.com/)的东东,这个网站上有很多驱动和方言,还可以连接excel呢,呵呵....好了下面是连接方法:
需要两个包的支持,1、jdbc连接access的驱动程序 (Access_JDBC30.jar)地址:http://www.hxtt.com/access.zip 2、access的方言包(hibernate.jar)地址:http://www.hxtt.com/test/hibernate.zip
下面是hibernate配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username"></property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">com.hxtt.support.hibernate.HxttAccessDialect</property>
<!-- <property name="hibernate.connection.url">jdbc:access:///f:/mdbfiles/aaa.mdb</property> -->
<property name="hibernate.connection.driver_class">com.hxtt.sql.access.AccessDriver</property>
<property name="hiberante.show_sql">true</property>
<mapping resource="Person.hbm.xml" />
</session-factory>
</hibernate-configuration>
连接access就是这样啦,很简单吧,o(∩_∩)o...哈哈