• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need To Store Data, But cannot have a database

 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When we create an application for saving our contacts, we create tables in SQL database or whatever, and deal with the database via the java code. when we need to give the software to the end user, we have to set the drivers, create the tables and all in his side. But, I need to develop an application that where the we don't have to create all the databases, tables, in end users machine.

I have seem some contact details management software (written in c#), they store the data inside it self( might me it is using some kind of INBUILT database), WE DON'T HAVE TO CREATE ANY DATABASE to run it at all.

I don't know how to store data without the help of a database. May be JTable? (I have no idea about JTable), or any other system? I need to create a software like that, which not need us to go and create a database in client side, and the application is capable of handling the data it self. And yes, it should allow us to navigate through the data, search data, delete, update, insert, etc. Please help
 
Pete Nelson
Ranch Hand
Posts: 147
Debian Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"cannot have a database" is a bit odd ... how can you store data if you're not allowed to store data?

If you are saying you cannot use an RDBMS on the network, there are a lot of filesystem-based databases (derby, bdb), and it's not uncommon to use a CSV or XML file as a (non-SQL) database. For a single-access datastore, you have a lot of options that don't require the complexity of a full RDMBS system.

Another option - if your data is encapsulated in a Class, serialize your classes to a folder. If that sounds interesting, see java.beans.XMLEncoder and java.beans.XMLDecoder .
 
Daniel Val
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yohan Weerasinghe wrote:Hi,

When we create an application for saving our contacts, we create tables in SQL database or whatever, and deal with the database via the java code. when we need to give the software to the end user, we have to set the drivers, create the tables and all in his side. But, I need to develop an application that where the we don't have to create all the databases, tables, in end users machine.


Still there are solutions where you can do that with a database server, except with an embedded one.

I used sqllite, not sure if it can be embedded in Java. HSQL can be embedded in Java. It might consume more memory, however this is very easy to impose these days on a client computer - few of them don't have at least 1 gig or 2.

Otherwise, your only approach would be to serialize your data in some folder and then load it from there.

D.
 
Patryk Sosinski
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Val wrote:

Otherwise, your only approach would be to serialize your data in some folder and then load it from there.




Yep, or store data in XML file (easy import, export, transfer etc.).
 
Tim Moores
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second the recommendation for embedding HSQLDB.
 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel Val wrote:I used sqllite, not sure if it can be embedded in Java.

It can. There is a JDBC driver available for SQLite.
 
Maneesh Godbole
Saloon Keeper
Posts: 11064
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Embedded apache derby might be another option you might want to consider.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for all of you for the comments. I really appreciate it. I never thought this much of solutions available I am gonna choose "embed database" solution. But now the case is, you all have given number of databases, so I am having a problem about which one to select . I will walk through all the documentations of those embed databases, and will select one. Thanks a lot for all of you help. I Will be back with a good result
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic