Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which database type should I use?

 
Joe Lemmer
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm looking for informed opinion on which database system I should be learning. I'm still learning Java really, but have used JDBC to connect to a mySQL database. While designing a little language app, I've run into a few issues.

I have created a few types of what I'm calling VocabElement classes as a convenient way of storing data about a particular word (eg for a noun what it looks like in the singular and plural in french and english and whether masculine or feminine, plus some other info). So the VocabElement objects will have variables with strings and some other info relevant to that word.

In order to store this info on the database, I have had to have a method that copies each of the VocabElement object's instance variables separately to a database and then when I want to use the word, I have to read a row of information on a database and have a method convert this into a VocabElement object.

It seems to me I might save a lot of time by just saving it as a VocabElement object.

So:
(a) Is it possible to save java objects directly to a database?
(b) If so, would mySQL do it, or should I be exploring some other system (Hibernate, Oracle, Glassfish??!!??)
(c) Also are there any speed issues or security issues that I should be aware of?

Thanks very much in advance.

Regards

Joe ;-)
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is possible to save the java object directly, but you would have to use a ORM Solution (Hibernate etc...) as then the appropriate SQL would be automatically generated. The object itself cannot be directly saved by SQL.
There would be speed and security issues but I guess they would assist for the betterment of the application. Like, you could put a constraint using the mapping (Hibernate...?) rather than on the DB, which you can't using SQL.
You would have to explore the options available.
 
Joe Lemmer
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Reehan,

Thanks very much for your reply. I will check out Hibernate.

Cheers

Joe :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic