Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC and Inheritance

 
Hemakanta Sethi
Greenhorn
Posts: 17
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai... Friends

I have a problem with inheritance, any one please guide me.

I can't understand, weather JDBC support inheritance or not ?
If yes then how, if not then how.

Advance Thanks....
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC uses inherhitance. CallableStatement extends PreparedStatement. But I don't think that is what you are asking.

JDBC just runs SQL. It doesn't do mapping to your object structure. Which means it can't support inheritance. Your code would need to do this.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15281
39
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC and inheritance are two completely different things, that don't really have anything to do with each other. So the question is a bit strange. Can you explain in more detail what you mean by this question?
 
Hemakanta Sethi
Greenhorn
Posts: 17
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:JDBC and inheritance are two completely different things, that don't really have anything to do with each other. So the question is a bit strange. Can you explain in more detail what you mean by this question?



In case of Hibernate, it supports the three basic inheritance mapping strategies. It means when ever we save a derived class object then hibernate automatically stores it's base class data into the Database table. Like it, i want to know JDBC support inheritance or not.
Thanks
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest you spend some time reading a JDBC tutorial. Then you should be able to answer for yourself whether JDBC supports inheritance -- whatever that might mean to you. Or at least it would make it easier for you to ask a more specific question.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Repeating my answer: No because JDBC doesn't map to objects. The question doesn't apply to JDBC.
 
Hemakanta Sethi
Greenhorn
Posts: 17
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, thanks for the helpful info!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic