Embed Derby DB with Netbeans Platform Application - Module

403 Views Asked by At

I developed a project in Netbeans Platform Application i.e. like Modules.

When i run my project from Netbeans 7.4, it works fine and doesn't show any DB exception.

Now i created a installer using Netbeans 7.4 for my project. 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";.

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. 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/nbm-crud.html

but dint get a solution.

2

There are 2 best solutions below

0
Dyre On

Hard to tell from your description, but could you be seeing this default schema with Netbeans issue ?

0
Alex Michael Raj On

Found the Solution..

  • launh or run the project after doing clean Build from the "dist" folder.
  • The new Database will be created in the "dist/project name" and you will get a error "Schema DB doesnt exists".
  • 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. And run the application agaiin.