zoukankan      html  css  js  c++  java
  • 【JDBC】Extra04 Mirosoft-Access-JDBC

    MS没提供Jdbc驱动,有一个第三方的UcanAcess驱动包

    <!-- https://mvnrepository.com/artifact/net.sf.ucanaccess/ucanaccess -->
    <dependency>
        <groupId>net.sf.ucanaccess</groupId>
        <artifactId>ucanaccess</artifactId>
        <version>5.0.0</version>
    </dependency>

    连接单元测试:

        @Test
        public void connectionTest() throws Exception {
            Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
            final String microSoftAccessDataBaseLocation = "C:\Users\Administrator\Documents\sample.accdb";
            final String UcanAccessConnectUrl = "jdbc:ucanaccess://" + microSoftAccessDataBaseLocation;
            Connection connection = DriverManager.getConnection(UcanAccessConnectUrl);
            System.out.println(connection);
            connection.close();
        }

    打印结果:

    13:33:50.933 [main] DEBUG com.healthmarketscience.jackcess.Index - unsupported collating sort order SortOrder[2052(0)] for text index (Db=sample.accdb;Table=MSysObjects;Index=0), making read-only
    13:33:50.950 [main] DEBUG com.healthmarketscience.jackcess.impl.DatabaseImpl - Could not find expected index on table MSysObjects (Db=sample.accdb)
    13:33:50.968 [main] DEBUG com.healthmarketscience.jackcess.impl.DatabaseImpl - Finished reading system catalog.  Tables: [user] (Db=sample.accdb)
    net.ucanaccess.jdbc.UcanaccessConnection@5b03b9fe[C:UsersAdministratorDocumentssample.accdb]
  • 相关阅读:
    day7随笔
    day6随笔
    day5笔记
    uniapp 全屏蒙版下的其他view禁止滑动
    uniapp scroll-view 组件右侧的滚动条
    uni 组件 头部
    根据两点的经纬度查询两点间的距离
    仅供学习使用的一些 相关vue类
    仅供学习使用的一些样式+行为
    百度地图简单调用
  • 原文地址:https://www.cnblogs.com/mindzone/p/13749238.html
Copyright © 2011-2022 走看看