I have created a Java application that uses a database, and I now want to build it into a jar file and make it so that the database works without NetBeans. I thought NetBeans would automatically include the database, but it doesn't.
The files that NetBeans include in the 'dist' folder when I build it look like this:
- dist
- lib
- derby.jar (Executable Jar File)
- derbyclient.jar (Executable Jar File)
- README
- WordFinder.jar (Executable Jar File)
- lib
Everything except the database-related code works when I launch the WordFinder.jar file after closing NetBeans.
I noticed that the database is using 'org.apache.derby.jdbc.ClientDriver', and I'm wondering, does that need to be 'org.apache.derby.jdbc.EmbeddedDriver' in order for it to include the database?
Are there any files that I need to include? I'm new to Java databases, so try to keep the instructions simple.
You need to start the database server in you computer, for doing that you need to go to your derby path (
C:\Program Files\Java\jdk1.8.0_45\db\bin
) and run thestartNetworkServer.bat
file