How to 'ship' data with stand-alone app?

I'm developing a stand-alone Java app. It needs to access some tables in order to work. Wwe're not talking about a huge amount of data here: maybe 3 tables with 400 rows and 5 cols each. If I don't know what applications or drivers will be on the users' machines, what is the best way to ship this data with the application in the installer? (I will be using InstallShield.) CSV text files?

Thanks,

Ed

[431 byte] By [ekozek] at [2007-9-26 12:01:15]
# 1
just compile it in a class of statics! all ready for use
mchan0 at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Good idea, except that I'd like the data to be in some kind of file that I can just replace and/or edit. Also, I'd like to be able to easily read the file via JDBC into a ResultSet.

Actually, if I included it as an Access database, could I use the JDBC_ODBC bridge to connect even if I haven't set up a DSN?

ekozek at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

No, the client needs to have a dsn set up on their machine. A type 1 or type 2 driver (of which JDBC ODBC is a type 1 driver needs to have a dsn set up.)

Why don't you use a database like cloudscape? It has java drivers and does not need to set up as a dsn on the client machine.

wgower at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

>A type 1 or type 2 driver (of which JDBC ODBC is a type

>1 driver needs to have a dsn set up.)

Not necessarily. A DSN-less connection is possible.

However, to use MS Access on a machine the user will have to have a ODBC MS Access driver installed. That is not part of the default install for windows.

>Why don't you use a database like cloudscape?

I don't believe cloudscape is free. So that would be a down side.

jschell at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

>Good idea, except that I'd like the data to be in some kind of file that I can just replace and/or edit.

Is this application a database application? In other words does it normally connect to a database and this data is just additional info? Then create an application/script which installs the data into the database.

If not then use a properties file. Or a pipe delimited file and just write a parser to read in into a hash table or something.

jschell at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6

> I don't believe cloudscape is free. So that would be a down side.

If Cloudscape is out there are free alternatives;

tinySQL - http://www.jepstone.net/tinySQL/

Mckoi SQL - http://www.mckoi.com/database/

HSQLDB - http://www.hsqldb.org/

tinySQL will give you JDBC access to simple formatted text files.

tubsy at 2007-7-2 2:24:35 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...