• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 153
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic