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: JDBC THIN driver10g query issue

Re: JDBC THIN driver10g query issue

From: Christophe Bonte <chrbonte_at_hotmail.com>
Date: Tue, 18 Jan 2005 16:33:55 +0100
Message-ID: <41ed2e1a$0$24420$4d4efb8e@news.be.uu.net>


Hello again Joe

I found the cause of the problem. I once more tried my luck searching in Metalink (although i don't like this site very much).

I first found bug no. 3686912. This looked very similar to my problem. In that bug report i followed a link to the base bug link 3472676.

I'll copy the information I found in that one



Diagnostic Analysis:

The issue is not related to just the setFetchSize of the Statement object, but is related to the combination of setting BOTH the setFetchSize of the Statement AND Resultset objects. .
Here are a few scenarios: .

If

        stmt.setFetchSize(X);
        rset.setFetchSize(Y);

then it fails on row X+1

If

        stmt.setFetchSize(Y);
        rset.setFetchSize(X);

then it fails on row Y + 1

If

//        stmt.setFetchSize(Y); (commented out)
          rset.setFetchSize(X);

then it fails on row 11

If

        stmt.setFetchSize(X);
        rset.setFetchSize(X);

then it works.

Removing both

        stmt.setFetchSize(X);
        rset.setFetchSize(X);

then it works.

It appears with 10G it only looks at the Statement object to set the FetchSize.
All the above scenarios work with the 9i Driver.

Workaround:


Use the 9i Driver or make sure the FetchSize for both objects are set to the same size.


I noticed that in our code we only had set the fetchsize for the resultset (which worked in 9i). I tried setting it also for the statement object and it worked :)

Thanks very much though for your efforts in wanting to help me.

Christophe

"Christophe Bonte" <chrbonte_at_hotmail.com> wrote in message news:41ed1745$0$24424$4d4efb8e_at_news.be.uu.net...
> Sorry. The column I was talking about has datatype NUMBER (38), not long
> and not date.
> ***
> ***

>

> Hello
>

> It's true. I can see more useful information now :). Here below the
> beginning part of the stacktrace.
>

> java.sql.SQLException: Numeric Overflow
> at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
> at
> oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:6797)
> at
> oracle.jdbc.driver.NumberCommonAccessor.getLong(NumberCommonAccessor.java:499)
> at
> oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:521)
> at oracle.jdbc.driver.OracleResultSet.getLong(OracleResultSet.java:1617)
> at be.mips.cyberlab.util.ResultSetEx.getDate(ResultSetEx.java:117)
> at
> be.mips.cyberlab.business.Observation.findByPatient(Observation.java:690)
> It looks like it happens with a query where i select a field that
> containsa date. When fetching the records the error seems to occur with
> with the getLong method of the resultset object. To avoid confusion, this
> column I'm talking about has the NUMBER (38) datatype, not date. It
> contains a number(= milliseconds after January 1, 1970, 0:00:00 GMT).
> Those are rather big numbers (for example 1009797793000, 1009530557171,
> ...). What could possibly be wrong? I'll google some more in the meantime.
> Thanks in advance. Christophe> "Joe Weinstein" <joeNOSPAM_at_bea.com> wrote
> in messagenews:41EBF5A1.1000506_at_bea.com...>>>>>> Christophe Bonte
> wrote:>>>>> Hello>>>>>> Here's the stacktrace below. I don't really know
> where to look fore moreinformation though: Tomcat forums, Oracle forums?
> Information that I findabout 'numeric overflow' is very vague. I only have
> this when I use the THINdriver. Everything works just fine with OCI.>>
> ...>>> be.mips.cyberlab.exception.MipsDBSelectException: Observation.java
> :java.sql.SQLException Numeric Overflow>>>
> atbe.mips.cyberlab.business.Observation.findByPatient(Observation.java:743)>>>>
> Hi. The trouble is that the code in Observation.java is catching the>>
> original Numeric Overflow error and creating a SQLException to throw.>>
> Can you look at that code? Can you print out the full original
> stacktrace>> of the Numeric Overflow exception?>>>> Joe Weinstein at
> BEA>>>>>
> atbe.mips.cyberlab.web.resultconsultation.ObservationContainer.loadObservations(ObservationContainer.java:93)>>>
> atbe.mips.cyberlab.web.resultconsultation.Manager.executeCommand(Manager.java:213)>>>
> atbe.mips.cyberlab.web.FrontDoor.getHtmlForServlet(FrontDoor.java:115)>>>
> at be.mips.cyberlab.web.AServlet.doGet(AServlet.java:70)>>> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)>>> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)>>>
> atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)>>>
> atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)>>>
> atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)>>>
> atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)>>>
> atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)>>>
> atorg.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)>>>
> at java.lang.Thread.run(Thread.java:536)>>>
> be.mips.cyberlab.exception.MipsException:be.mips.cyberlab.web.resultconsultation.Manager
> :be.mips.cyberlab.exception.M>>> ipsDBSelectException Observation.java :
> java.sql.SQLException NumericOverflow>>>
> atbe.mips.cyberlab.web.resultconsultation.Manager.executeCommand(Manager.java:302)>>>
> atbe.mips.cyberlab.web.FrontDoor.getHtmlForServlet(FrontDoor.java:115)>>>
> at be.mips.cyberlab.web.AServlet.doGet(AServlet.java:70)>>> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)>>> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)>>>
> atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)>>>
> atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)>>>
> atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)>>>
> atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)>>>
> atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)>>>
> atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)>>>
> atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)>>>
> atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)>>>
> atorg.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458)>>>
> atorg.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)>>>
> at java.lang.Thread.run(Thread.java:536)>>>>
>
Received on Tue Jan 18 2005 - 09:33:55 CST

Original text of this message

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