简体   繁体   English

将 Ucanaccess 与 msaccess 一起使用的问题

[英]Problems Using Ucanaccess with msaccess

I am using the IDE Nebeans8.1 and data base access 2019.我正在使用 IDE Nebeans8.1 和数据库访问 2019。
I got an error while trying to connect to my datavse using ucanaccess and all needed libraries.我在尝试使用 ucanaccess 和所有需要的库连接到我的 datavse 时出错。

My ConnectionDatabase class:我的ConnectionDatabase类:


package hospital;

import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.JOptionPane;

/**
 *
 ** @author MicroSoft**
 */
public class ConnectionDatabase {

    static Connection con = null;

    public static Connection connet(){

        try {
            Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
            con= DriverManager.getConnection("jdbc:ucanaccess://C://Users//MicroSoft//Documents//NetBeansProjects//hospital//hospital.accdb"); 
            JOptionPane.showMessageDialog(null, " pass ");

        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex.getMessage());
        }
        return con;
    }

    public static void main(String[] args) {
        con = connet();
    }
}

the error:错误:

java.lang.NoClassDefFoundError

问题留言

You are using the wrong version of the commons-lang dependency.您使用了错误版本的 commons-lang 依赖项。

You need a version of commons-lang 3, but you are using commons-lang 2.6.您需要一个 commons-lang 3 版本,但您使用的是 commons-lang 2.6。 Try replacing this with a version of commons-lang 3.尝试用一个版本的 commons-lang 3 替换它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM