开发者

sqlite DB doesn't get wrapp in my exe

I have created a Java Swing program which uses a SQLite database to store the hardware details of the pc. When I run that program as a java application, hardware details get stored in the DB. I have to generate an exe of that java program. I created an exe using ant build, launch4j and Innosetup. I added the DB(sys_data.db) in launch4j in classpath. But when I run that开发者_开发知识库 exe, the hardware details doesn't stored in the DB.

Any suggestion please?


A database is not a jar file - therefore this is totally unrelated to the classpath. If you load the db by a relative path the program will search in the current directory.

My suggestion would be to use a fully qualified path when loading the SQLite database. You can retrieve for example the path where your main jar is located - see How to get the path of a running JAR file? for details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜