Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes JDBC and Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC and Inheritance" Watch "JDBC and Inheritance" New topic
Author

JDBC and Inheritance

Hemakanta Sethi
Greenhorn

Joined: Jul 19, 2011
Posts: 17

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

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?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Hemakanta Sethi
Greenhorn

Joined: Jul 19, 2011
Posts: 17

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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Repeating my answer: No because JDBC doesn't map to objects. The question doesn't apply to JDBC.
Hemakanta Sethi
Greenhorn

Joined: Jul 19, 2011
Posts: 17

Okay, thanks for the helpful info!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC and Inheritance