Re: connectionless resultset [please help]




<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
.



Relevant Pages

  • Question about ResultSet
    ... I'm making a database populated and manipulated through a JTable, SQL ... the ResultSet. ... public void setValueAt(Object value, int row, int col) ...
    (comp.lang.java.databases)
  • Simple database access inJava
    ... Database Access with Java ... Often you need to access a database from your java application. ... The resultset is basically a set of records which are taversable by the ...
    (comp.lang.java.programmer)
  • Re: persisting resultsets after connection is closed
    ... > We typically keep our database methods in classes separate ... > "getMyQueryStuff" that method converts the resultset ... so that connection is now left unreturned to the ... Though I try to design another layer between the business logic and the ...
    (comp.lang.java.databases)
  • Re: paging
    ... > Well foxpro is no database server, ... > it has the full resultset. ... > desktop applications. ...
    (microsoft.public.fox.vfp.queries-sql)
  • Re: Newbie - general question about ADO.NET
    ... Sure, it carries some overhead, but worrying about the minor amount ... If a database is localy on PC - ... ADO.NET is connectionless, but I don't care about connection, ... >>> because the database is located on PocketPC. ...
    (microsoft.public.pocketpc.developer)