gpt4 book ai didi

JayBird 中的连接问题

转载 作者:行者123 更新时间:2023-12-02 05:53:42 25 4
gpt4 key购买 nike

我是 Firebird 的新手,使用其 Java 版本 Jaybird,但无法从数据库(.fdb 文件)连接。问题是这样的:

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544375. unavailable database

OR

java.lang.RuntimeException: Failed to initilize Jaybird native library. This is most likley due to a failure to load the firebird client library.

Using following code:

Class.forName("org.firebirdsql.jdbc.FBDriver").newInstance();
connection = DriverManager.getConnection("jdbc:firebirdsql://localhost/3050:C:/XLNKREPOS /FIRBIRDXA.FDB", "SYSDBA", "masterkey");

Eclipse 项目的构建路径中有以下文件:

  • jaybird-full-2.1.5.jar
  • jaybird21.dll
  • fbclient.dll
  • fbembed.dll

还使用 JVM 参数作为 -Djava.library.path="D:\Shared\Firebird\Jaybird-2.1.5JDK_1.5"

请告诉我我的方法有什么问题?


感谢 RRUZ 的回复。

实际上我的连接字符串中的“C:/XLNKREPOS”后面没有空格,这是复制过去的错误。我一次又一次地收到以下 SQL 异常:

org.firebirdsql.jdbc.FBSQLException:GDS 异常。 335544375.数据库不可用

并且该数据库没有在其他程序中使用。

希望我的这篇文章能让您理解我的问题。

谢谢

最佳答案

OP 混合了 Jaybird 支持的两种 jdbc url 格式。

要么使用

jdbc:firebirdsql://[host]{:[port]}/[path]

jdbc:firebirdsql:[host]{/[port]}:[path]

{...} 用于表示可选部分

关于JayBird 中的连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1459163/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com