result set issue

result set issue

Post by xe.. » Fri, 24 Sep 1999 04:00:00



Hello:

I have a ResultSet that I have created. My problem is this: I am sending
this resultset to another app to be parsed for the data inside. I am not
sure if this RsultSet will hold all my data from the quesry all the time
or if some can be lost while passing the ResultSet. Also according to
the API if I close the Statement that created the ResultSet, then the
ResultSet will also be destroyed. Well after a few tests I have
determined that this is not true. I make a ResultSet and then close all
statements and conenctions and pass the ResultSet to another class which
then parses it for the data inside.

Can someone please tell me if what I am doing is good or not?? From what
I understand, the ResultSet is a type of Map. Is this correct?

Thanks in Advance,
Exeter

 
 
 

result set issue

Post by Joseph Weinstei » Fri, 24 Sep 1999 04:00:00



> Hello:

> I have a ResultSet that I have created. My problem is this: I am sending
> this resultset to another app to be parsed for the data inside. I am not
> sure if this RsultSet will hold all my data from the quesry all the time
> or if some can be lost while passing the ResultSet. Also according to
> the API if I close the Statement that created the ResultSet, then the
> ResultSet will also be destroyed. Well after a few tests I have
> determined that this is not true. I make a ResultSet and then close all
> statements and conenctions and pass the ResultSet to another class which
> then parses it for the data inside.

You're playing with something that is against the spec, and shouldn't work.
Whatever driver you're using is broke, if it doesn't close a resultset when you
close the statement. Also, usually, a resultset dos not contain data. It usually
just gets it off the net from the DBMS when you ask. This is why most resultsets
don't let you go backwards (previous()), and some don't even let you ask for
the same datum twice.
   You *shouldn't* be able to send a resultset anywhere, but if you can get away with
it with your driver and DBMS, good luck.
Joe

--
PS: Hey folks, we're hiring Java engineers for our WebLogic
    Engineering group in downtown S.F. Send me your resume.
--------------------------------------------------------------------------------
                    The Weblogic Application Server from BEA
         JavaWorld Editor's Choice Award: Best Web Application Server
  Java Developer's Journal Editor's Choice Award: Best Web Application Server
     Crossroads A-List Award: Rapid Application Development Tools for Java
Intelligent Enterprise RealWare: Best Application Using a Component Architecture
               http://weblogic.beasys.com/press/awards/index.htm

 
 
 

result set issue

Post by Bruce Blacksha » Sat, 25 Sep 1999 04:00:00



> Hello:

> I have a ResultSet that I have created. My problem is this: I am sending
> this resultset to another app to be parsed for the data inside. I am not
> sure if this RsultSet will hold all my data from the quesry all the time
> or if some can be lost while passing the ResultSet. Also according to
> the API if I close the Statement that created the ResultSet, then the
> ResultSet will also be destroyed. Well after a few tests I have
> determined that this is not true. I make a ResultSet and then close all
> statements and conenctions and pass the ResultSet to another class which
> then parses it for the data inside.

This is not a good idea. It *may* work because garbage collection has not
yet kicked in and the socket connection to the DB server may not have been
closed when the connection was closed. But as soon as the Connection object
is garbaged collected you'll lose the connection.

If you are trying to write reliable code this is not an option.

Bruce Blackshaw
London, UK

 
 
 

1. Oracle Gateway - result set issues - results not matching data in DB2

We have been experiencing difficulties with our applications since we
have upgraded to Oracle 8.1.7 and the new version of the Oracle
Transparent Gateway. Our applications connecting to DB2 v5 previously
returned result sets as expected. Since the upgrade, certain queries
return no qualifying rows, specifically in the scenario detailed
herein:

1: DB2 - has column (let's call it column TEST) defined as Char(3)  -
Not Null with Default. The table to which this column belongs has many
rows in which the TEST column has no data.
2: User queries (through PB through the Gateway) requesting all rows
where TEST = "".
3: No data is returned.
4: If the query is changed to request all columns where TEST = " ",
the query works.

Does anyone know if the Gateway has a problem with empty strings in a
query? Apparently this isn't a length issue, since the column is
Char(3) and the query works when requesting columns with " ". I don't
understand why the query no longer works with the empty string "". Any
help would be greatly appreciated!!

--------------------------------------------------------------------------------

2. q: examples needed for noorder sequence and regular table with partition index

3. Result Sets vs copying result sets into memory.

4. ORACLE 8 / HP-UX

5. OPENROWSET performance issue or SET FMTONLY OFF issue

6. US-NC DBA in Beautiful North Carolina

7. OBDB Result size <> ISQL Result Set

8. problem with replication (filter)

9. Comparing Result Set to Result Table

10. Receiving results of a SP result set

11. [Querying A Subset of Results in a Result Set]

12. Set Precedence Against Multiple Result Sets?

13. Set Criteria is not affecting resulting set