Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to automate creation of MSAccess Database?

 
Siegfried Heintze
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed that some of the archetypes for maven will automagically create a new database and table and run some dbunit tests.

I would like to automate the creation of MSAccess databases. I think the only ways to do it are
(1) Call native code via JNI (a windows only approach) or,
(2) Encode the binary contents of an empty msaccess database as java source code (maybe a long byte array?) and recreate such a file as needed. Does anyone have a utility that will already take an existing binary file and encode it as java source code? Assuming the answer is no, how would I write such a beast?

Thanks,
Siegfried
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The http://jackcess.sourceforge.net/ library can create, read and write .mdb files, so it may be what you're looking for.
 
Siamak Saarmann
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf,

Do you know how stable is this library?

I have a simulation software with a lot of settings file. I want to get rid of these files and I was looking for a simple and single file database with very basic SQL queries which also works under Windows/Linux. I have very few queries.

Do you suggest this library for my requirements?

Thank you for your time.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using this library -with which I have no experience whatsoever- only makes sense if you NEED an Access database. If -as you mention- cross-platform functionality is desirable it's not a good choice, because using Access limits you to Windows. (Also note that Jackcess can only read and write MDB files, not query them.) I'd probably use HSQLDB in your case.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic