-
Resultset implementation
While learning JDBC, I found the Resultset is an
interface. Yet we can use its function like rs.next().
How is this possible?
I am aware when you execute a statement it returns a resultset
object. But how is a Resultset object created, when there
is no Resultset class?
thanks,
KNR
-
Re: Resultset implementation
What you are getting is an object of a class (unknown to you) that
implements the ResultSet interface. You can find out what class it actually
is by examining rs.getClass().
This use of interfaces shouldn't be surprising, because it's the main reason
that interfaces exist in Java.
KNR <kanicheril@yahoo.com> wrote in message news:39510117$1@news.devx.com...
>
> While learning JDBC, I found the Resultset is an
> interface. Yet we can use its function like rs.next().
>
> How is this possible?
>
> I am aware when you execute a statement it returns a resultset
> object. But how is a Resultset object created, when there
> is no Resultset class?
>
> thanks,
>
> KNR
-
Re: Resultset implementation
This is the magic of Multiple inheritence!!!!
"KNR" <kanicheril@yahoo.com> wrote:
>
>While learning JDBC, I found the Resultset is an
>interface. Yet we can use its function like rs.next().
>
>How is this possible?
>
>I am aware when you execute a statement it returns a resultset
>object. But how is a Resultset object created, when there
>is no Resultset class?
>
>thanks,
>
>KNR
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks