> Hi all,
> I'm trying to set up a solution to use a flat file as a database
> and be able to run basic SQL queries on it in a Tomcat environment.
> I'm thinking about getting JDBC set up and supposedly it has a built-in
> driver to use flat files as the database. Only problem is i have no
> clue how to go about doing this. Any suggestions? Thanks
Do you HAVE to use a flatfile? If not, you might want to look into
Apache Derby (http://db.apache.org/derby/) or HSQLDB
(http://www.hsqldb.org/), which are lightweight DBs that you can embedded
into your Java programs.
- Oliver
MyClue - 05 Jul 2006 15:05 GMT
i think i might. the data is going to be exported to me as a flat file
so that's what I have to work with. i found something called CSVJDBC
which is a driver to help JDBC work with comma separated value files
but I'm not sure if that's what i'm looking for.
> > Hi all,
> > I'm trying to set up a solution to use a flat file as a database
[quoted text clipped - 9 lines]
>
> - Oliver
Oliver Wong - 05 Jul 2006 15:22 GMT
[Post re-ordered]
>> > Hi all,
>> > I'm trying to set up a solution to use a flat file as a database
[quoted text clipped - 12 lines]
> which is a driver to help JDBC work with comma separated value files
> but I'm not sure if that's what i'm looking for.
You could take the flat file, load it into a transient RDB, and do all
your processing from there. Will you make changes to the data, and do these
changes need to be reflected in the file again?
- Oliver
MyClue - 05 Jul 2006 19:57 GMT
most likely no changes will be required. as far as i can see, all i
need to do is be able to access the data and display it.
> [Post re-ordered]
>
[quoted text clipped - 20 lines]
>
> - Oliver
Oliver Wong - 05 Jul 2006 21:13 GMT
[Post re-ordered]
>> >> > Hi all,
>> >> > I'm trying to set up a solution to use a flat file as a database
[quoted text clipped - 23 lines]
> most likely no changes will be required. as far as i can see, all i
> need to do is be able to access the data and display it.
Since you're going to be running SQL queries, I recommend you do as I
said above: Read in and parse the flat file, and do inserts into a transient
DB. Then, do all your queries against the DB. When the program ends, the DB
gets garbage collected and disappears.
- Oliver