kgromeo
kgromeo

Reputation: 3

jackcess - database pathname in databasebuilder.open

I have a Microsoft Access database called perso.accdb. I use the Jackcess library to try to open it using the following code taken from official documentation here

Database db = DatabaseBuilder.open(new File("mydb.mdb")); Sounds simple enough, but where exactly do I place my "perso.accdb"?! else how to write an absolute pathname?

thanks in advance

Upvotes: 0

Views: 213

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123654

The file location is the string argument to the File object constructor. For a path relative to the current OS working directory in effect when your application runs you can use

Database db = DatabaseBuilder.open(new File("datafiles/perso.accdb"));

For an absolute path you can use something like

Database db = DatabaseBuilder.open(new File("C:/path/to/perso.accdb"));

Upvotes: 1

Related Questions