0

I've created a database application from this tutorial and now I have a question. How can I put this application (with database file) to JAR file?

In my case this application only works when Netbeans is open. When I export to JAR file then I get a connection error.

Thanks for help.

Newd
  • 2,148
  • 2
  • 15
  • 31
  • 1
    Possible duplicate of [Export JAR with Netbeans](http://stackoverflow.com/questions/4498047/export-jar-with-netbeans) – Sean Bright Jan 13 '17 at 17:31
  • I can do it ,but databe is broken. –  Jan 13 '17 at 17:39
  • 2
    I'm not sure you have enough info here for anyone to actually provide an answer. What do you mean by connection error? Do you have all the files you need? Did you make sure that the jar file that tutorial has you pull in is also part of your jar? – Brandon Kindred Jan 13 '17 at 17:57
  • 1
    Are you looking to read and write to the database once you've packaged the program as a jar? It is possible to package a database file in with a JAR but you will only have read access as JARs are read only files. If you want read and write access then you will need to look at implementing some kind of helper to create/read/write the DB file each time you run your JAR. Often DB files are stored in a users APPDATE folder, in Java you can access this path using: `System.getenv("LOCALAPPDATA")` – Dan Gardner Jan 13 '17 at 18:00

0 Answers0