| | |
database or csv
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
It depends on how you need to access the data, but I would imagine the simple file would suffice. You don't mention what the data is, but basically you have the equivalent of a single table. With file-based storage you will need to write the methods yourself if you want to query the data in any manner. If such queries are straightforward, such as just finding a couple entries based on simple criteria, you really don't need the database.
That said, if you expect to grow to have several other tables of information and will need to correlate information between them in a variety of ways, you should go ahead and start with a database.
McKoi and H2 are a couple of good open-source Java embedded databases (they don't need a separate installation on a server) if you decide you want to use the database.
That said, if you expect to grow to have several other tables of information and will need to correlate information between them in a variety of ways, you should go ahead and start with a database.
McKoi and H2 are a couple of good open-source Java embedded databases (they don't need a separate installation on a server) if you decide you want to use the database.
Last edited by Ezzaral; Dec 4th, 2007 at 2:56 pm.
•
•
Join Date: Nov 2007
Posts: 62
Reputation:
Solved Threads: 7
That's a good question. For this small amount of data you can work with cvs or xml files. Setting up the database and making it work in your code will take longer that doing so for the text files.
However, parsing files is easy but it is slow, so if, in cases like this, there's even the slightest possibility of expansion, you might want to use the database. If you have the time, you'll be able to learn all about persistence in programming which is really a big concern these days. As a developer you'll encounter persistence problems a lot, so starting to work with it the good way would be a good idea.
It depends on the time you are able to spend on it.
When you do choose to go for the database, you might want to look into Hibernate, it provides easy data persistence using object/relational mapping. They have good tutorials that will have you run basic persistence in no time. Seeing you would be able to manage with cvs files, a database scheme cannot be complicated. Therefor your Hibernate configuration won't be too.
You can find Hibernate here: link.
And an introductional tutorial (that should allready get your little project off the ground) here: read chapter one.
If you have any more questions about this, feel free to ask them.
Why am I over-enthousiastic? I'm a fan of Hibernate and a believer of the ORM solution.
Black Box
However, parsing files is easy but it is slow, so if, in cases like this, there's even the slightest possibility of expansion, you might want to use the database. If you have the time, you'll be able to learn all about persistence in programming which is really a big concern these days. As a developer you'll encounter persistence problems a lot, so starting to work with it the good way would be a good idea.
It depends on the time you are able to spend on it.
When you do choose to go for the database, you might want to look into Hibernate, it provides easy data persistence using object/relational mapping. They have good tutorials that will have you run basic persistence in no time. Seeing you would be able to manage with cvs files, a database scheme cannot be complicated. Therefor your Hibernate configuration won't be too.
You can find Hibernate here: link.
And an introductional tutorial (that should allready get your little project off the ground) here: read chapter one.
If you have any more questions about this, feel free to ask them.
Why am I over-enthousiastic? I'm a fan of Hibernate and a believer of the ORM solution.

Black Box
•
•
•
•
It depends on how you need to access the data, but I would imagine the simple file would suffice. You don't mention what the data is, but basically you have the equivalent of a single table. With file-based storage you will need to write the methods yourself if you want to query the data in any manner. If such queries are straightforward, such as just finding a couple entries based on simple criteria, you really don't need the database.
That said, if you expect to grow to have several other tables of information and will need to correlate information between them in a variety of ways, you should go ahead and start with a database.
McKoi and H2 are a couple of good open-source Java embedded databases (they don't need a separate installation on a server) if you decide you want to use the database.
I don`t think I`ll need more than 1 table(hope not).
and last thing, it is possible to have more than 100 records, but that depends on how my program will behave when I`ll do some queries on 1-2-300 records database/csv. I really want to obtain a fast and relatively light program.
Last edited by claudiu_is; Dec 4th, 2007 at 4:34 pm.
•
•
•
•
...
When you do choose to go for the database, you might want to look into Hibernate, it provides easy data persistence using object/relational mapping. They have good tutorials that will have you run basic persistence in no time. Seeing you would be able to manage with cvs files, a database scheme cannot be complicated. Therefor your Hibernate configuration won't be too.
...
Black Box
Last edited by claudiu_is; Dec 4th, 2007 at 4:50 pm.
•
•
Join Date: Nov 2007
Posts: 62
Reputation:
Solved Threads: 7
Well, the only thing you'd have to do is follow the guide really. It will take you little time to setup everything you need (including the link of the database to your program).
You can use about every database with Hibernate, though the tutorial uses HSQL DB. Downloading & installation (about a minute or two of work) is explained in the tutorial. If you have specific questions about that, I've been through it myself (including that one tutorial), ask away.
Black Box
You can use about every database with Hibernate, though the tutorial uses HSQL DB. Downloading & installation (about a minute or two of work) is explained in the tutorial. If you have specific questions about that, I've been through it myself (including that one tutorial), ask away.
Black Box
![]() |
Similar Threads
- reading .csv using jsp (JSP)
- Importing csv file to SQL Server Using VB.Net (VB.NET)
- database update using excell (Windows NT / 2000 / XP)
- Import excel records into ASP database (ASP)
- excel as VB database (Visual Basic 4 / 5 / 6)
- Reading CSV in VC++ (C++)
- ASP.NET Import/Export (ASP.NET)
- html table to .csv (HTML and CSS)
- Save a text file in an csv.file with ascii? (PHP)
Other Threads in the Java Forum
- Previous Thread: compliler
- Next Thread: Null pointer on building a binary tree
| Thread Tools | Search this Thread |
3d @param affinetransform android api applet application arc arguments array arrays automation binary bluetooth byte capture chat class classes click client code color compare component count database design detection eclipse eclipsedevelopment encryption error event exception fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide if_statement image input integer interface j2me java java.xls javaprojects jni jpanel julia keytool keyword linux list loop macintosh map method methods mobile netbeans newbie object os pong print problem producer program programming project projectideas read recursion replaysolutions rim scanner screen server set size sms sort sql string swing terminal threads transforms tree ui web windows






