Re: connectionless resultset [please help]
- From: "Bjorn Abelli" <bjorn_abelli@xxxxxxxxxxxxxxxxxxxxx>
- Date: 29 May 2006 00:44:23 +0200
<usmanusb@xxxxxxxxx> wrote...
I need to have connectionless resultset like in
recordset in dotnet.
"Need to have" is a very strong phrasing IMHO. There might be some reasons
to why the "connectionless" approach isn't so widely spread...
I have one class which i make for all database related
functions like retrieving records from database. What i
want to do is when i pass sql select query to the method
of my database class. my method process it and return
resultset obj to the caller. so caller can handle the
resultset as required.
Here I begin to shiver (just me, but anyway...).
It isn't quite clear what the "caller" is, and what relation that has to the
database. I'm not sure if I would design a layer outside of the database
layer to use any database specific classes at all. Not even the interfaces
from java.sql.*.
On the other side of my view, I can't see how it wouldn't be possible for
things *within* the database layer to use a *connected* ResultSet...
As we know that resultset depends on statement and which
requires to have connection with the database i.e. connection
oriented. So can anyone help me to sort out my problem that
is how to have connectionless resultset or is there any other
good solution with performance advantage.
Aha, here it came, the belief that a "connectionless ResultSet" would have
better performace, than to "disconnect" the layers with more generic
collections to pass between them... ;-)
Well, enough of my own personal views. You can disregard what I have ranted
about above, and just read the links below. I don't know what version of JDK
you're using, and not what database or driver you use either, but if you're
lucky, the driver has implemented something called RowSet, or more
specifically CachedRowSet, which might do your thing.
http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/CachedRowSet.html
Look in the documentation for your driver, to see if it has that
implemented, then there you have your disconnected ResultSet.
/// Bjorn A
Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
.
- Follow-Ups:
- Re: connectionless resultset [please help]
- From: kuassi.mensah@xxxxxxxxx
- Re: connectionless resultset [please help]
- References:
- connectionless resultset [please help]
- From: usmanusb
- connectionless resultset [please help]
- Prev by Date: connectionless resultset [please help]
- Next by Date: Re: connectionless resultset [please help]
- Previous by thread: connectionless resultset [please help]
- Next by thread: Re: connectionless resultset [please help]
- Index(es):
Relevant Pages
|
|