• 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

Store Java object in MySQL Database

 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to store and retrive Java object in MySQL database.

How can I do that?

Is there any samlpe code?

Reg,
Chetan
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to read about JDBC.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and object serialisation.
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chetan Parekh:
I want to store and retrive Java object in MySQL database.

How can I do that?

Is there any samlpe code?

Reg,
Chetan



Hello Chetan,
This can be done in multiple ways but i can tell you one approach for the same.You can use JDO i.e. Java Data Objects API and call its methods to store and retrive java objects as it is in any database, be it MYSQL.I have done this using JDO .I used Castor JDO for the same.I hope its fine by you.You can visit site of Castor JDO and see more details there.

Alternatively you can use CMP i.e. Container manager persistence featired offered by EJB.

These days hibernate is another OR mapping tool which you can for object persistence.

Saurabh
 
reply
    Bookmark Topic Watch Topic
  • New Topic