简体   繁体   English

在Netbeans平台应用程序中嵌入Derby DB-模块

[英]Embed Derby DB with Netbeans Platform Application - Module

I developed a project in Netbeans Platform Application ie like Modules. 我在Netbeans Platform Application中开发了一个项目,例如Modules。

When i run my project from Netbeans 7.4, it works fine and doesn't show any DB exception. 当我从Netbeans 7.4运行我的项目时,它工作正常,并且不显示任何数据库异常。

Now i created a installer using Netbeans 7.4 for my project. 现在,我为项目使用Netbeans 7.4创建了一个安装程序。 wen i install it, the DB is also installed but its not recognizing the DB and my connection url is public final static String connectionURL = "jdbc:derby:ProjectDB;create=true;user=user;password=p@ssword"; 我在安装它的同时,还安装了数据库,但是它无法识别数据库,并且我的连接URL是public final static String connectionURL = "jdbc:derby:ProjectDB;create=true;user=user;password=p@ssword"; .

When i copy paste the DB alone in a location eg: " d:\\project DB " and change the code as connectionURL = "jdbc:derby:D:\\\\project DB; create=true; user=user; password=p@ss" it works fine. 当我复制时,将数据库单独粘贴到例如“ d:\\ project DB”的位置,并将代码更改为connectionURL = "jdbc:derby:D:\\\\project DB; create=true; user=user; password=p@ss" ,效果很好。 But i need to create along with the installer or want my project to recognize the DB. 但是我需要与安装程序一起创建,或者希望我的项目能够识别数据库。

When i searched i got the below links 当我搜索时,我得到以下链接

https://platform.netbeans.org/tutorials/70/nbm-crud.html https://platform.netbeans.org/tutorials/70/nbm-crud.html

https://platform.netbeans.org/tutorials/nbm-crud.html https://platform.netbeans.org/tutorials/nbm-crud.html

but dint get a solution. 但是有点解决。

很难从您的描述中看出来,但是您能看到Netbeans问题的默认模式吗?

Found the Solution.. 找到了解决方案..

  • launh or run the project after doing clean Build from the "dist" folder. 在“ dist”文件夹中执行clean Build之后,启动或运行项目。
  • The new Database will be created in the "dist/project name" and you will get a error "Schema DB doesnt exists". 新的数据库将在“ dist / project name”中创建,并且将出现错误“ Schema DB不存在”。
  • Now close the application and delete the DB in the "dist/project name" folder and copy-paste the DB(this i did for Derby Database) which you use for your project. 现在关闭应用程序,并删除“ dist / project name”文件夹中的数据库,然后复制粘贴该数据库(我为Derby Database所做的工作)。 And run the application agaiin. 再次运行该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM