Server-side cursors for ResultSets - a pattern? (and what about Oracle?)
- From: "StM" <stmsat@xxxxxxxxx>
- Date: 4 Dec 2006 07:56:23 -0800
I need to find a way to obtain server-side cursors using JDBC with both
Oracle and SQL Server, with the least possible amount of differences.
The reason for this anti-performance request: I have to import huge
tables, for a one-time execution, possibly without using third party
drivers and having no criteria to fetch the data in a number of smaller
amounts.
In the long and terrifying following dissertation I report the only way
I've found to do this in SQL Server (I've still to test it); what about
Oracle? Do you have any hints, in particular or in general?
Thank you
StM
####################
# General dissertation #
####################
For what I know, the only way to use server-side cursors using the SQL
Server JDBC driver, for example, is to add a "SelectMethod=cursor" to
the JDBC connection string.
http://edocs.bea.com/wls/docs92/jdbc_drivers/mssqlserver.html
For other kind of databases, you have instead to create statements with
tricks like
stmt = conn.createStatement( java.sql.ResultSet.TYPE_FORWARD_ONLY,
java.sql.ResultSet.CONCUR_READ_ONLY );
stmt.setFetchSize(Integer.MIN_VALUE);
or similar, that work as *suggestions* to the driver ("ehi, you the
driver, I've cast the ServerSideCursor spell, I've full mana and I'm a
level 26 programmer, you have to do what I want").
Source for that: http://www.hibernate.org/314.html
I don't know about Oracle. (at the link above it says something awful
about it... I hope there's some way out).
.
- Follow-Ups:
- Re: Server-side cursors for ResultSets - a pattern? (and what about Oracle?)
- From: joeNOSPAM@xxxxxxx
- Re: Server-side cursors for ResultSets - a pattern? (and what about Oracle?)
- Prev by Date: how can i move to the last record of recordset
- Next by Date: Re: Server-side cursors for ResultSets - a pattern? (and what about Oracle?)
- Previous by thread: how can i move to the last record of recordset
- Next by thread: Re: Server-side cursors for ResultSets - a pattern? (and what about Oracle?)
- Index(es):
Relevant Pages
|