且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

连接到Derby网络服务器时找不到数据库错误

更新时间:2023-11-22 15:04:10

通过JDBC网址,它看起来像您正在尝试连接到Derby服务器而不是嵌入式实例。如果您尝试连接到服务器实例,请注意以下几点:

By the JDBC url, it's looks like you're trying to connect to a Derby server vs. an embedded instance. If you are trying to connect to a server instance, here are some considerations:


  • 您是否自己启动了服务器,mydb是否已经存在?

  • 如果没有,你是否传递了正确的参数来创建(例如; create = true)
    示例:jdbc:derby:// localhost: 1527 / dbname; create = true

  • 如果mydb确实存在,您是否将服务器指向正确的位置?

    • 也取决于用于启动derby的内容(例如嵌入式vs网络驱动程序),默认数据库位置也不同。你可以在这里阅读关于它

    • did you start the server yourself, did mydb already exists?
    • if not, did you pass in the correct params to create (e.g. ;create=true) example: jdbc:derby://localhost:1527/dbname;create=true
    • if mydb did exists, are you pointing the server to the correct location?
      • also, depending on what was used to start derby (e.g. embedded vs network driver) default database locations are different as well. You can read about it here

      基本上你得到的例外是Derby说它无法找到你的数据库 - 它基本上是路径问题。

      Basically the exception you're getting is that Derby's saying it can't find your database - it's basically a path issue.