• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write to file using ORM / Use txt file as database ?

 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want use the normal text file(CSV is also fine) as database, like I need to save the data bean to a file and should be able to populate the bean from the file.

Can it be achieved using any ORM tools like hibernate or toplink, Please suggest if any alternative way to achieve this ?


Thanks.
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately ORM tools like Hibernate, toplink support only relational database. My suggestion would be to use excel file as a datastore and use Apache POI to read and write data from the same.
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Malatesh Karabisti wrote:Hi All,

I want use the normal text file(CSV is also fine) as database, like I need to save the data bean to a file and should be able to populate the bean from the file.

Can it be achieved using any ORM tools like hibernate or toplink, Please suggest if any alternative way to achieve this ?


Thanks.

Why do you want to do this? Seriously, just use a database.
 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need this for demo application. we are not using the DB to store the data we just need to read hard coded data.

Thanks
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use an in-memory embedded database, such as h2,hsql or derby.

Populate the DB on startup with your "hard-coded" data, or import from a csv, then let the app. fly.

Pat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic