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

Home -> Community -> Usenet -> c.d.o.misc -> Re: jdbc driver - NumberFormatException

Re: jdbc driver - NumberFormatException

From: bung ho <bung_ho_at_hotmail.com>
Date: 17 Jun 2003 14:43:14 -0700
Message-ID: <567a1b1.0306171343.22049225@posting.google.com>


Sybrand Bakker <gooiditweg_at_nospam.demon.nl> wrote in message news:<s8iuevkspvn8dur0ptclgsl7vjk8elnpdu_at_4ax.com>...
> On Tue, 17 Jun 2003 11:22:23 +0300, Pavel Zlatarev
> <pavel.zlatarev_at_sap.com> wrote:
>
> >Hi,
> >
> >I'm using Oracle9i 9.2.0.3 JDBC Driver - classes12.zip from http://download.oracle.com/otn/utilities_drivers/jdbc/9203/classes12.zip
> >with Additional RowSet support - ocrs12.zip from http://download.oracle.com/otn/utilities_drivers/jdbc/9203/ocrs12.zip
> >
> >I execute "create table test (value NCLOB)" and it finishes correctly.
> >Then "select * from test" returns a ResultSet and
> >
> >resultSet.getMetaData().getPrecision(1) throws
> >
> >java.lang.NumberFormatException: 4294967295
> > at java.lang.Integer.parseInt(Integer.java:435)
> > at java.lang.Integer.parseInt(Integer.java:472)
> > at oracle.jdbc.driver.OracleResultSetMetaData.getPrecision(OracleResultSetMetaData.java:331)
> >
> >Does anyone know the right place to report it?
> >I tried http://otn.oracle.com/forums/sqlj_jdbc.html with no response.
> >
> >Thanks
>
>
> I don't think this should be reported at all. Your column has the
> *National* Character Large Object datatype, and you are returning it
> as an int. Are you surprised you are getting exceptions? If there is
> character data in the column, you will run into the above exception.
> What You See Is What You Get!
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address

it looks to me like he's in fact querying the metadata (as in, getMetaData().getPrecision(1)), not the actual value of the nclob. so throwing an exception doesn't sound like appropriate behavior for the driver. on the other hand one may argue that the precision of an NCLOB column is meaningless anyway. so i guess the workaround is, don't query the precision if the column is an NCLOB (or any other column that gives that precision of 4294967295, which i guess is too large for an int).

for kicks, i tried it on an 817 database and it didn't throw, it returned 0. Received on Tue Jun 17 2003 - 16:43:14 CDT

Original text of this message

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