This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32603
    
215

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14991
    
  27

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 8 API documentation
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
Sheriff

Joined: Oct 14, 2005
Posts: 19738
    
  10

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

Joined: May 26, 2003
Posts: 32603
    
215

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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC and Inheritance
 
It's not a secret anymore!