• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need To Store Data, But cannot have a database

 
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 147
Eclipse IDE Tomcat Server Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.).
 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I second the recommendation for embedding HSQLDB.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Embedded apache derby might be another option you might want to consider.
 
Yohan Weerasinghe
Ranch Hand
Posts: 507
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic