Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ResultSet getXXXX Behavior

Re: ResultSet getXXXX Behavior

From: JV <jvirgil_at_optonline.net>
Date: Mon, 01 Nov 1999 19:46:01 GMT
Message-ID: <Z5mT3.3996$Hc.9627481@news.optonline.net>


We have since seen that but have decided to not keep them in order based on benchmarks and manageability.

We switched drivers from jdbc:oracle:thin (1.1) to Sun's jdbc:odbc (1.1) and it worked. We also did a benchmark on the differences between index vs column name and found the diff to be negligible.

On a 2,329 row, 4 column ResultSet (excluding query time) the total elapse time for converting from the ResultSet to instance variables:

Columns out of order:
By column_name was 1:31.211
By column_index was 1:30.881
diff = .33 seconds

Column names in order:
By column_name was 1:30.970
By column_index was 1:30.740
diff = .23 seconds

Seeing as that our applications only need to do this for 1 row at a time and not 2000+ we have decided to stay with column_name for code manageability. Column names out of order will be easier to code with going forward. Once we are done with the application, and if we determine that some optomization is needed, we can then go back and optimize just the hot spots.

What was scary about this was the fact that it took 1:30 minutes! to do the operation. This really demonstrates the cost of decomposing a ResultSet in Java.

Thanks for the help
JV

Jon Skeet wrote in message ...
>jvirgil_at_optonline.net wrote:
>> Actually let me clarify - The Oracle Thin driver enforces the column
order
>> on the getXXX. The sun jdbc:odbc driver (1.1) did not.
>
>Just to give some indication that this is mentioned: in the JDK 1.2.2
>documentation for ResultSet, there is the sentence:
>
>"For maximum portability, ResultSet columns within each row should be
>read in left-to-right order and each column should be read only once."
>
>--
>Jon Skeet - skeet_at_pobox.com
>http://www.pobox.com/~skeet/
Received on Mon Nov 01 1999 - 13:46:01 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US