I have created a simple Java application (ReadingAccessDB) that reads table rows from MS Access database. The program packages the java class file in jdbc folder (package jdbc; ), and the database file is one level up.
here is the code:
For example if the class file is in C:\jdbc\ReadingAccessDB.class, the database file "carpets.mdb" is in C:\
when using JVM "C:\java jdbc.ReadingAccessDB", the application works fine. However, I want to archive the application with the database file in a jar file so that it can be executed from any location. Could some one help
[ January 26, 2006: Message edited by: A Alqtn ]
[ January 26, 2006: Message edited by: A Alqtn ] [ January 26, 2006: Message edited by: A Alqtn ]
Well to confirm what was said in your other thread and what I am pretty sure I told you a few days ago on another forum.
You cannot do this. You cannot embed your Access database in a jar and access it with JDBC. There are a number of technical impossibilities that make this a non-starter. You will have to ship the database as a seperate file (although you could deploy in one setup or zip file) and have it reside in a proper Windows directory.
There is no workaround that will make this (Access) work directly from a Jar.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com