且构网

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

使用 derby 在 netbeans 中查询嵌入式数据库

更新时间:2023-01-12 16:50:04

你告诉我们我已经创建了一个嵌入式数据库......并向其中添加了数据.

因此,此数据库必须在 Netbeans 服务中可见.

Thus, this database must be visible in Netbeans Services.

NO ;create=true !
您应该使用在属性中看到的相同 URL 进行连接.仅此而已.
展开数据库 URL 或查看底部.

NO ;create=true !
You should connect with the same URL you see in the properties. Nothing more.
Expand Database URL or look at the bottom.

 con = DriverManager.getConnection("jdbc:derby:C:/Dokumente und Einstellungen/Administrator/.netbeans-derby/sample","app","app");

在嵌入式模式下,Derby 在应用程序的 JVM(Java 虚拟机)中运行.在这种模式下,只有应用程序可以访问数据库,例如另一个用户/应用程序将无法访问数据库.

In the embedded mode Derby runs within the JVM (Java Virtual Machine) of the application. In this mode only the application can access the database, e.g. another user / application will not be able to access the database.

只有一个应用程序可以访问数据库.
因此,在 Netbeans 服务中断开连接,即您要在应用程序中连接到的数据库.

Only one Application can acces the Database.
So disconnect in Netbeans Services, the Database you want to connect to in your Application.