问题
I am midway through a database application(SWING). I am using Java DB and NetBeans 7.1.2. Within the IDE, the app runs good, provided I initially connect the database manually in the 'services' window. Also, I have added the derby.jar and derbyclient.jar files to the libraries. But when running the app from the "dist" folder, it fails to connect to the database. I want to know whether i can attach the db within the jar file so that i can run the app from outside the IDE. Thank you.
回答1:
You can do the following
- Start
java DB
outside the netbeans or - If you use Derby, go with
Embedded mode
. Such a way you can run your application without separate db server.
来源:https://stackoverflow.com/questions/12330496/attach-derby-database-into-jar-file