近期一项目要用到桌面数据库,access太不安全,本来想用sybase,可惜sybase的人报价说不限用户的ASA版本要500W,真是强盗,无奈上网查了下,很多人说firebird不错,于是就决定用这个了。先在sourceforge下载了firebird并安装了,又下载了FbMaestro。我用FbMaestro建了一个embedded类型的数据库,地址为D:\Project\test.fdb,在数据库里创建了表并加入了部分数据。但是在Java程序中怎么都连接不上这个数据库。请各位大侠指点下。一下是我的数据库链接程序和报错代码:driverName = "org.firebirdsql.jdbc.FBDriver";
URLName = "jdbc:firebirdsql:embedded:E:/Project/test.fdb";
user = "sysdba";
password = "masterkey";Failed to initilize Jaybird native library. This is most likley due to a failure to load the firebird client library.
java.lang.RuntimeException: Failed to initilize Jaybird native library. This is most likley due to a failure to load the firebird client library.
        at org.firebirdsql.gds.impl.jni.JniGDSImpl.attemptToLoadAClientLibraryFromList(JniGDSImpl.java:100)
        at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:31)
        at org.firebirdsql.gds.impl.jni.EmbeddedGDSImpl.<init>(EmbeddedGDSImpl.java:21)
        at org.firebirdsql.gds.impl.jni.EmbeddedGDSFactoryPlugin.getGDS(EmbeddedGDSFactoryPlugin.java:40)
        at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219)
        at org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:117)
        at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at ConnPool.ConnObject.getConn(ConnObject.java:83)
        at ConnPool.ConnectionPool.addOneConnToPoll(ConnectionPool.java:178)
        at ConnPool.ConnectionPool.initPoll(ConnectionPool.java:222)
        at ConnPool.ConnectionPool.<clinit>(ConnectionPool.java:51)
        at ConnPool.DatabaseAccess.<init>(DatabaseAccess.java:24)
        at main.Main.main(Main.java:23)

解决方案 »

  1.   

    是不是javabird驱动没加?
    libfbclientlibrary的jar包?
    http://www.firebird.net.cn/forum_list.asp?forum_id=9
      

  2.   

    你安装的JDK和Jaybird的版本都是什么?
      

  3.   

    用下面的URL试试。
    URLName = "jdbc:firebirdsql:127.0.0.1:E:/Project/test.fdb?sql_dialect=1";
      

  4.   

    哈哈,终于搞明白了,原来用程序来连接firebird还真的挺麻烦,不仅要用到三个jar包,还要用到四个dll文件,而且版本还得一至才行,唉虽然麻烦,但总算研究通了。不过还是感谢大家了,结贴给分。
      

  5.   

    我很想知道,我一直连不成功,可以教我吗?总结一下发给我好不好,[email protected]