How do I store Java objects in a database? [closed]

I am creating my first ‘real’ program in Java, and I am trying to create a database that stores different courses at my school. The issue that I’m having is that I want to be able to check if somebody has completed all of their pre-requisites before going into any chosen class. But in order to do this, would I not need to store an instance of the pre-requisite in the pre-requisite field of the chosen course and run some sort of isComplete() method? That is—-is there some sort of way to create an object oriented database? I have heard of serialization, but I’m unsure if it’s the most efficient way to do what I’m hoping to achieve. Thank you in advance

  • While it is theoretically possible to use serialization, you probably shouldn’t, since no human would be able to examine the database directly and discern its contents. I think there have existed (and may still exist) databases which directly support Java objects, though I don’t know if it addresses the problem I described. Usually, applications convert each attribute of a data object to a column in a table in an SQL-based database. It’s not all that much work.

    – 

Leave a Comment