1

[I know this question has been asked here and here, but I don't quite understand the answers, and I didn't want to ask questions on old threads.]

Problem:
I have a project that I created in NetBeans (7.01), and I created a database to go with it using Java DB. I would like to have a .exe file that I can run on any computer, so that when someone clicks it, the program runs like it should (establish the connection with the db, run the rest of the Java code).

What I know:
After a little reading, I see that if I didn't have the DB, the executable that I am looking for would really just be the .jar file. I also found that I needed to create an embedded db which in part means that I need to change the URL from jdbc:derby://localhost... to something different (but I'm not sure what something should be. Just a path to the source code files perhaps with the db information?).

Question:
I have a bunch of pieces (not sure if they're all right), but I am not sure how to put them all together. Could someone let me know how to create an embedded DB and send that, and the rest of the program, to an .exe?

Thanks in advance!

Community
  • 1
  • 1
JustBlossom
  • 1,259
  • 3
  • 24
  • 53
  • Can you show the bunch of relevant pieces that you talk about? – Chetan Kinger May 19 '15 at 16:23
  • 1. I have my project .jar at C:/.../NetbeansPackages/dist/project.jar. 2. Based on one of the questions I read, I created a path to to C:/.../NetbeansPackages/dist/dbitems which in my mind is supposed to store the DB infor. 3. I can see where the Java DB URL is in Netbeans, but I don't know how to change it. I feel like if I can change it, maybe then the project.jar will include it as an embedded db. Does that make sense? – JustBlossom May 19 '15 at 16:38
  • Will your database for your application be a read-only database, or will your application wish to update it? If you want to update it, will you want to keep those updates at the end of each run? Or will you want to start over fresh with a clean database at the start of each run? – Bryan Pendleton May 19 '15 at 23:32
  • I created this application with the idea that I would be able to update it and then keep those updates at the end of each run (that is what I ideally want to happen). However, if someone has a read-only solution, I'll take that too because I might be able to construct a solution for what I really want from there. – JustBlossom May 19 '15 at 23:37

0 Answers0