ResultSets and Tuple processing???

ResultSets and Tuple processing???

Post by HKXL » Fri, 18 Feb 2000 04:00:00



Hi,
I have done some JDBC previously where I fired some SQL queries at a database
from a Java application and get the results in a ResultSet. Can anybody tell me
whether the ResultSet contain the actual result or does it merely references
the actual data in the database?

The reason why I am asking this is because I need to process a very hugh table
in a database one tuple at a time. My fear is that my machine may not be able
to handle such a large amount of data if the ResultSet actually returns all the
data from my query. However, if the ResultSet merely references the data and
does not take up much space itself, then I will have no problems.

What I want to do is to read each tuples in a database and process them. Using
SQL queries to retrieve one row at a time is clearly not an option because of
the time required for each query to execute and return the result. Can anybody
tell me  whether there is any other way of processing one tuple from  a table
at a time?

Thank you very much for any help,
Herry.

 
 
 

ResultSets and Tuple processing???

Post by Thomas Mulle » Fri, 18 Feb 2000 04:00:00



Quote:> Hi,
> I have done some JDBC previously where I fired some SQL queries at a
database
> from a Java application and get the results in a ResultSet. Can anybody
tell me
> whether the ResultSet contain the actual result or does it merely
references
> the actual data in the database?

> The reason why I am asking this is because I need to process a very hugh
table
> in a database one tuple at a time. My fear is that my machine may not be
able
> to handle such a large amount of data if the ResultSet actually returns
all the
> data from my query. However, if the ResultSet merely references the data
and
> does not take up much space itself, then I will have no problems.

> What I want to do is to read each tuples in a database and process them.
Using
> SQL queries to retrieve one row at a time is clearly not an option because
of
> the time required for each query to execute and return the result. Can
anybody
> tell me  whether there is any other way of processing one tuple from  a
table
> at a time?

It is left to the various JDBC implementors how many rows to cache at the
client side. You can be absolutely sure, however, that no sane driver vendor
will fetch all rows satisfying a query in one batch to the client. For
implementations compliant to the JDBC 2.0 API, you may call
ResultSet.setFetchSize(int nmb) to give the driver a hint of how many rows
to fetch when new rows are needed for a given query.

If you think about it, even the server won't prefetch all rows satisfying a
query, that is if we talk about arbitrary numbers. The DBMS most likely hold
a prefetched cache of rows, and fills it from the db-file(s) as more rows
are being processed.

java-program --- driver --- client-socket  <-(db-protocol)->
server-socket --- db-server ---- DBMS ---- db-files on disk

--

Thomas

 
 
 

1. Processing Multiple Resultsets using RDO 2.0

Hi!
I want to process multiple resultsets using RDO 2.0 and Oracle 7.3 but
am unable to do so because when I submit 2 SQL statements separated by a

space( or comma, semi-colon) in the query it is giving me errors. VB 5.0

documentation says that we can use semi-colons for SQL Server database.
I am not sure which delimiter to use for the Oracle database. I am using

Microsoft ODBC for Oracle driver (Level II compliant). Can anyone please

help me out.
Thanks,
Regards,
Prashanti

2. Help!

3. ResultSet processing slowly

4. avi files

5. multithread processing resultset

6. US-PA: Pittsburgh-Oracle SQL Server Architect

7. ResultSet processing

8. Newbie HELP Move Data

9. Can't process multiple result sets when first resultset is empty

10. How do we know if a process is user process or system process

11. user process,server process,application process

12. multiple resultsets into 1 resultset ???

13. resultset.first() and resultset.getFetchSize() not working