Server-side cursors for ResultSets - a pattern? (and what about Oracle?)



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

.



Relevant Pages

  • RE: ODBC to Oracle 64bit missing rows
    ... the set of Oracle queries that I'm running ... through the linked server right now haven't given me that error.... ... I'm trucking on with 64-bit & Oracle's OLE DB drivers. ... I am on SQL Server 2005, ...
    (microsoft.public.sqlserver.connect)
  • Re: Linked Servers
    ... We have two servers, one MS SQL Server, the other Oracle. ... "x.x.x.x" was actually the IP address of the server. ... Funny, since MSDAORA is part of Windows, it should be there. ...
    (comp.databases.ms-sqlserver)
  • Oracle Connectivity Issue
    ... I've worked at sites with this configuration (SQL 2000 with an Oracle ... linked server) before with success. ... Now i am going to install sql server clustering, ... server,through linked server transfering data. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Oracle linked server error
    ... Set Up and Troubleshoot a Linked Server to Oracle in SQL Server ...
    (microsoft.public.sqlserver.connect)
  • Re: Update / Insert Table throught DTS
    ... If you can't then you could create an Oracle linked server from your SQL ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ... > I have source data in Oracle database and the destination in MS Sql server ...
    (microsoft.public.sqlserver.dts)