<i id='05kbs'><tr id='05kbs'><dt id='05kbs'><q id='05kbs'><span id='05kbs'><b id='05kbs'><form id='05kbs'><ins id='05kbs'></ins><ul id='05kbs'></ul><sub id='05kbs'></sub></form><legend id='05kbs'></legend><bdo id='05kbs'><pre id='05kbs'><center id='05kbs'></center></pre></bdo></b><th id='05kbs'></th></span></q></dt></tr></i><div id='05kbs'><tfoot id='05kbs'></tfoot><dl id='05kbs'><fieldset id='05kbs'></fieldset></dl></div>
    1. <legend id='05kbs'><style id='05kbs'><dir id='05kbs'><q id='05kbs'></q></dir></style></legend>
    2. <tfoot id='05kbs'></tfoot>

      <small id='05kbs'></small><noframes id='05kbs'>

      • <bdo id='05kbs'></bdo><ul id='05kbs'></ul>

        在eclipse中通过jdbc连接DB2数据库

        时间:2023-09-30
        <legend id='fCctK'><style id='fCctK'><dir id='fCctK'><q id='fCctK'></q></dir></style></legend>
        <tfoot id='fCctK'></tfoot>

        <small id='fCctK'></small><noframes id='fCctK'>

            <tbody id='fCctK'></tbody>
            • <bdo id='fCctK'></bdo><ul id='fCctK'></ul>

                <i id='fCctK'><tr id='fCctK'><dt id='fCctK'><q id='fCctK'><span id='fCctK'><b id='fCctK'><form id='fCctK'><ins id='fCctK'></ins><ul id='fCctK'></ul><sub id='fCctK'></sub></form><legend id='fCctK'></legend><bdo id='fCctK'><pre id='fCctK'><center id='fCctK'></center></pre></bdo></b><th id='fCctK'></th></span></q></dt></tr></i><div id='fCctK'><tfoot id='fCctK'></tfoot><dl id='fCctK'><fieldset id='fCctK'></fieldset></dl></div>

                1. 本文介绍了在eclipse中通过jdbc连接DB2数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试通过 JDBC 使用 Eclipse(Juno 版)连接到 IBM DB2 数据库.我已将驱动程序(外部 jar 文件)添加到我的项目中,并且驱动程序已正确加载...

                  I'm trying to connect to an IBM DB2 database with Eclipse (version Juno) via JDBC. I've added the drivers (external jar files) to my project and the driver is loaded correctly ...

                  public static void main(String[] args) throws SQLException, ClassNotFoundException {
                      Class.forName("com.ibm.db2.jcc.DB2Driver");
                      System.out.println("Driver loaded");
                  
                      Connection dbConn = DriverManager.getConnection("jdbc:db2://***.**.***.*:50000/BWUEBDB", "username", "password");
                      System.out.println("Connected");
                  }
                  

                  我也知道连接数据(数据库路径、用户名、密码)是正确的.但我得到一个 java.lang.NoClassDefFoundError:

                  I also know that the connection data (database path, username, password) is correct. But I get a java.lang.NoClassDefFoundError:

                  Exception in thread "main" java.lang.NoClassDefFoundError: sun/io/UnknownCharacterException
                      at com.ibm.db2.jcc.b.a.<init>(a.java:238)
                      at com.ibm.db2.jcc.b.b.a(b.java:1624)
                      at com.ibm.db2.jcc.c.p.a(p.java:350)
                      at com.ibm.db2.jcc.c.p.<init>(p.java:404)
                      at com.ibm.db2.jcc.b.b.<init>(b.java:256)
                      at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:163)
                      at java.sql.DriverManager.getConnection(Unknown Source)
                      at java.sql.DriverManager.getConnection(Unknown Source)
                      at AppTest.main(AppTest.java:17)
                  Caused by: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException
                      at java.net.URLClassLoader$1.run(Unknown Source)
                      at java.net.URLClassLoader$1.run(Unknown Source)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at java.net.URLClassLoader.findClass(Unknown Source)
                      at java.lang.ClassLoader.loadClass(Unknown Source)
                      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
                      at java.lang.ClassLoader.loadClass(Unknown Source)
                      ... 9 more
                  

                  项目属性一定有问题,但我真的不知道去哪里找.

                  There must be something wrong with the project properties but I really don't know where to look for.

                  推荐答案

                  我遇到了同样的错误.我使用 java 8 运行它,我切换到 Java 7 并且它工作正常.

                  I was getting the same error. I was running it using java 8, I switched to Java 7 and it worked.

                  这篇关于在eclipse中通过jdbc连接DB2数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:java的db2连接问题 下一篇:Lob 已关闭.错误代码=-4470,SQLSTATE=null

                  相关文章

                  最新文章

                  <small id='PvhPP'></small><noframes id='PvhPP'>

                      <tfoot id='PvhPP'></tfoot>
                      <legend id='PvhPP'><style id='PvhPP'><dir id='PvhPP'><q id='PvhPP'></q></dir></style></legend>
                        <bdo id='PvhPP'></bdo><ul id='PvhPP'></ul>
                    1. <i id='PvhPP'><tr id='PvhPP'><dt id='PvhPP'><q id='PvhPP'><span id='PvhPP'><b id='PvhPP'><form id='PvhPP'><ins id='PvhPP'></ins><ul id='PvhPP'></ul><sub id='PvhPP'></sub></form><legend id='PvhPP'></legend><bdo id='PvhPP'><pre id='PvhPP'><center id='PvhPP'></center></pre></bdo></b><th id='PvhPP'></th></span></q></dt></tr></i><div id='PvhPP'><tfoot id='PvhPP'></tfoot><dl id='PvhPP'><fieldset id='PvhPP'></fieldset></dl></div>