Home > Archive > SQL Server JDBC > March 2006 > How to change to using direct vs. cursor for queries within connec









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to change to using direct vs. cursor for queries within connec
Bob Heingartner

2006-03-13, 1:23 pm

I am using the release version of SQL 2005 JDBC driver.
The JDBC driver help says that there is a connection property called
selectMethod, which sets whether result sets are directly read into memory or
a cursor is used. The direct method is definitely faster for me, but it will
not work with results sets of over 100,000 records. So, I want to use the
direct method 95% of the time, and the cursor method for those few cases
where I might read huge numbers of records. So, I need to be able to set
which method to use after I already have the database connection. Is there
any way to change this connection property for an existing connection, or can
it only be set when you get a new connection? It is really awkard for me if I
have to get a new connection just to change this property.
Joe Weinstein

2006-03-13, 1:23 pm



Bob Heingartner wrote:

> I am using the release version of SQL 2005 JDBC driver.
> The JDBC driver help says that there is a connection property called
> selectMethod, which sets whether result sets are directly read into memory or
> a cursor is used. The direct method is definitely faster for me, but it will
> not work with results sets of over 100,000 records. So, I want to use the
> direct method 95% of the time, and the cursor method for those few cases
> where I might read huge numbers of records. So, I need to be able to set
> which method to use after I already have the database connection. Is there
> any way to change this connection property for an existing connection, or can
> it only be set when you get a new connection? It is really awkard for me if I
> have to get a new connection just to change this property.


Hi. There is no way currently to set/change it on a running connection,
but there is also no reason why it couldn't, so that is a good feature
request.
However, what's the chance we can alter your applicaiton logic/architecture?
Selecting 100,000 rows from the DBMS to a JDBC client sounds at first blush to
violate the cardinal rule of RDBMS performance: Work on raw data where it is, in
the DBMS. If you want to make a rocking chair in Guam, you don't call the great
Northwest to send you timber. ;)
Joe

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com