如果derby.jar在Eclipse工作区中,则无法连接到Derby数据库

时间:2023-01-17 15:45:26

I've been trying to create a Derby DB via Eclipse Data Tools Platform and at the beginning I couldn't manage to get it to work.. no matter what I did, I always got the same error:

我一直在尝试通过Eclipse Data Tools Platform创建一个Derby DB,一开始我无法让它工作......不管我做了什么,我总是得到同样的错误:

Could not connect to New Derby.
Error creating SQL Model Connection connection to New Derby. (Error: null)
java.lang.NullPointerException
Error creating JDBC Connection connection to New Derby. (Error: null)
java.lang.NullPointerException

While I was trying this the derby.jar file containing the driver was inside "workspace/myproject/lib" folder. Then I put the same exact file to my Desktop, set the driver to point to the new location of my derby.jar and all started to work automagically...

当我尝试这个时,包含驱动程序的derby.jar文件位于“workspace / myproject / lib”文件夹中。然后我将相同的文件放到我的桌面上,将驱动程序设置为指向我的derby.jar的新位置,并且所有文件都开始自动运行...

I did some experiments and it happens that it works everywhere EXCEPT when I put inside my Eclipse workspace folder. Why?

我做了一些实验,它发生在任何地方都有效除了当我放入我的Eclipse工作区文件夹时。为什么?

And most important: if I want to deploy my application on different machines do I need the derby.jar inside my project folder (and thus inside the .jar of my project)?

最重要的是:如果我想在不同的机器上部署我的应用程序,我是否需要在我的项目文件夹中的derby.jar(因此在我的项目的.jar中)?

Thanks in advance to everyone

在此先感谢大家



EDIT: I already added derby.jar to the project through Eclipse interface, here's how:

编辑:我已经通过Eclipse界面将derby.jar添加到项目中,具体如下:


如果derby.jar在Eclipse工作区中,则无法连接到Derby数据库


如果derby.jar在Eclipse工作区中,则无法连接到Derby数据库


如果derby.jar在Eclipse工作区中,则无法连接到Derby数据库

1 个解决方案

#1


0  

You have to add the jar file using eclipse's interface. This website shows how:

你必须使用eclipse的界面添加jar文件。该网站显示如何:

http://www.cs.duke.edu/courses/cps004g/fall05/assign/final/addlibrary.html

#1


0  

You have to add the jar file using eclipse's interface. This website shows how:

你必须使用eclipse的界面添加jar文件。该网站显示如何:

http://www.cs.duke.edu/courses/cps004g/fall05/assign/final/addlibrary.html