Re: Prepared Statement




"lakshmi Ashok" wrote...

A query plan is generated each time a query needs to be executed.
What we do with a prepared stmt is to prevent generation of this
query plan each time.

Not necessarily. It *can* be used in that way, but it's really up to the
implementor.

Not all databases makes those query plans...

A pointer to a result set will not exist if you close the
connection itself. Hence, the actual result set could be
somewhere on the DB cache and the interface Result set
could be just a pointer to that memory

And that's how many drivers have it implemented, but it's not a guarantee.
Not all databases uses that kind of cursors, and even if they do, it's not a
guarantee that the driver will make use of it...

Some drivers have more thorogh documentation on what to expect from the
drivers, with possibly even more functionality built in, as the interfaces
only tells us the "minimum" requirements of the implementations.

E.g. if you use OraclePreparedStatements, there are additional getXxx and
setXxx methods to deal with the Oracle specific types.

In some drivers the implementation of Statement have even overridden the
toString method in order to get a "readable" representation of the statement
made, but this is not a requirement, so in many cases they have simply used
the inherited method from Object.

.... this is a part I am also little bit confused about

To add to that confusion...

The interfaces ResultSet, Statement, etc, are just that, interfaces, which
are implemented by classes within the JDBC driver.

Some may make use of specific database functionality and simply "forward"
requests from Java, others may have it built into the driver itself, e.g. to
hold a collection of the results in the memory, etc...

The implementations of the interfaces varies very much, mostly depending on
which database they target.

The only thing the interfaces really guarantee, is that there will be some
sort of implementation for each method in the implementing classes, nothing
more...

/// Bjorn A



Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
.



Relevant Pages

  • kernel panic when running tcpdump
    ... # Firmware Drivers ... # Other IDE chipsets support ... most of these also require special kernel boot parameters ... # Userland interfaces ...
    (Linux-Kernel)
  • 2.6.31.5: Kernel freeze after http: page allocation failure. order:1, mode:0x20
    ... this coincides with updating the kernel from 2.6.30.3 yesterday, ... The only functional patch applied is 'userspace-printk' which allows ... # Device Drivers ... # Userland interfaces ...
    (Linux-Kernel)
  • [PATCH] PCIERR : interfaces for synchronous I/O error detection on driver
    ... This patch proposes new interfaces, that known by few as iochk_*, ... for synchronous I/O error detection on PCI drivers. ... I suppose that proposed interfaces will solve most of remaining issues. ... - i.e. this feature improves Serviceability. ...
    (Linux-Kernel)
  • Re: New MB - Single Local Area Connection
    ... I went through installing the drivers again last night once you confirmed ... that there was no reason XP-H should be able to support two Lan interfaces. ... I am glad to hear that XP Home should support two Lan interfaces however. ... Home edition for this new PC but after enabling both interfaces in the ...
    (microsoft.public.windowsxp.network_web)
  • Re: [PATCH RFC] [1/9] Core module symbol namespaces code and intro.
    ... that explicit mechanisms are better than implicit contracts. ... is very hard with thousands of exported symbol. ... There are still classes of drivers. ... use interfaces that are really generic driver interfaces and fairly stable ...
    (Linux-Kernel)