Re: Interface question

From: Ryan Stewart (zaphod_at_no.texas.spam.net)
Date: 12/30/03


Date: Tue, 30 Dec 2003 16:13:36 -0600


"Matt Humphrey" <matthNOSPAM@iviz.com> wrote in message
news:ishIb.8809$Vv2.3917727@news1.news.adelphia.net...
>
> "ms" <msmsmsms782@hotmail.com> wrote in message
> news:cbb08f30.0312300616.52213f27@posting.google.com...
> > As a Java newbie this is perhaps a simple question for this group.
> >
> > I understand how Java interfaces work and that they don't have an
> > implementation. What I don't therefore understand is how some
> > interfaces in Java API (such as the ResultSet) can have an
> > implementation.
>
> As you have noted, the definition of an interface is not itself an
> implementation. However, other classes subsequently fulfill the contract
of
> the interface by implementing the methods. The key advantage is that
> numerous other totally disparate classes can fulfill the same interface
and
> thereby be treated as the same kind of object.
>
> Cheers,
> Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/

This is something I've wondered about in the past. In the java.sql package,
Driver, Connection, Statement, and ResultSet are all interfaces. However, a
Driver returns a Connection, a Connection returns a Statement, and a
Statement returns a ResultSet. After reading through the DriverManager
source, it appears to me that a "driver" must be supplied externally, and
this driver package (jar?) would have to have classes that implement all
these interfaces plus the others in java.sql (Struct, PreparedStatement,
Blob, etc). It would be those classes that do the actual work. That makes
sense as it would allow individual vendors to write everything specifically
to work with their database, which is what a driver is in the first place.
Is there anyone here with more experience that could confirm or correct this
speculation?

-- 
Ryan Stewart, A1C USAF
805 CSPTS/SCBE


Relevant Pages

  • Re: Interface question
    ... > Driver, Connection, Statement, and ResultSet are all interfaces. ... > sense as it would allow individual vendors to write everything specifically ...
    (comp.lang.java.programmer)
  • Re: VxWorks 6.6 - Ethernet interface driver support
    ... Ethernet interface cards, deploying the "Intel PRO/1000 VxBus Enhanced ... Network Driver" in conjunction with the "Generic PHY driver", ... these interfaces. ...   MII_Bus @ 0x005073cc ...
    (comp.os.vxworks)
  • Re: HP-PB 10/100 10.20 driver?
    ... If there is no downloadable driver, ... an HP-PB FDDI card crippled with a 1500 byte MTU. ... the 100BT interfaces were ... Size Size Size Time Throughput local remote local remote ...
    (comp.sys.hp.hpux)
  • Re: VxWorks 6.6 - Ethernet interface driver support
    ... electrical Ethernet interfaces with optical Ethernet ... interfaces (DSS PMC card), so I wanted to disable the Generic PHY ... driver would result in removing also the Intel PRO/ ... CTRL register bits RFCE (Receive Flow Control Enable) and TCFE ...
    (comp.os.vxworks)
  • Re: VxWorks 6.6 - Ethernet interface driver support
    ... electrical Ethernet interfaces with optical Ethernet ... interfaces (DSS PMC card), so I wanted to disable the Generic PHY ... driver would result in removing also the Intel PRO/ ... CTRL register bit LRST is set ...
    (comp.os.vxworks)