sql simulation with jsp/jdbc and flat files

M

MyClue

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
 
O

Oliver Wong

MyClue said:
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
 
M

MyClue

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.
 
O

Oliver Wong

[Post re-ordered]

MyClue said:
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.

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
 
M

MyClue

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.



Oliver said:
[Post re-ordered]

MyClue said:
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.

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
 
O

Oliver Wong

[Post re-ordered]

MyClue said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top