没试过,但我想hibernate最终也是通过jdbc来访问数据库的
把connection.driver_class设置成sun.jdbc.odbc.JdbcOdbcDriver
connection.url设为jdbc:odbc:XXXX应该就差不多了吧

解决方案 »

  1.   

    sorry,忽略了一个dialect的问题,下面是hibernate支持的数据库列表
    ACCESS不在其中哦
    Please click "Edit this page" and share your experiences!Hibernate is regularly tested with the following SQL databases:DB2 7.1, 7.2, 8.1 
    MySQL 3.23, 4.0, 4.1
    PostgreSQL 7.1.2, 7.2, 7.3, 7.4
    Oracle 8i, 9i, 10g
    Sybase 12.5 (JConnect 5.5)
    HypersonicSQL 1.61, 1.7.0, 1.7.2, 1.8
    Microsoft SQL Server 2000
    SAP DB 7.3
    HSQL DB
    Hibernate has also been tested with and is believed to be compatible with current versions of:Apache Derby
    Informix
    Ingres
    FrontBase
    Mckoi SQL
    Firebird (1.5 with JayBird 1.01 tested)
    Interbase (6.0.1 tested)
    Progress 9
    Pointbase Embedded (4.3 tested)
    HP NonStop SQL/MX 2.0 (requires Dialect from HP)
    It is highly likely that most features of Hibernate (i.e. everything except DDL schema generation) will work perfectly with many other relational databases. You may easily add a new SQL dialect by extending the existing dialects. Keep in mind that some features of the query language are not supported for databases which do not have subqueries.
      

  2.   

    不过小的应用可以用HSQL代替ACCESS哈,
    这是个嵌入式的数据库,就一个jar文件,不需要安装数据库服务器,很方便的
      

  3.   

    <hibernate-configuration>
    <session-factory name="java:/hibernate/HibernateFactory">
    <property name="show_sql">true</property>
    <property name="connection.driver_class">
    sun.jdbc.odbc.JdbcOdbcDriver
    </property>
    <property name="connection.url">
    jdbc:odbc:Test
    </property>
    <property name="connection.username">
    wei
    </property>
    <property name="connection.password">
    wei
    </property>
    <property name="dialect">
    org.hibernate.dialect.GenericDialect
    </property>
    <mapping resource="Customer.hbm.xml" />
    </session-factory>
    </hibernate-configuration>