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: strange results from JDBC query

Re: strange results from JDBC query

From: Dave Penn <djpenn3_at_hotmail.com_spammenot>
Date: Tue, 31 Aug 2004 06:44:51 -0500
Message-ID: <jMKdnejdBPji-ancRVn-vQ@comcast.com>


David,

Top 'o the morning to you.

My application server runs on jdk 1.4.0, and the Oracle installation uses whatever JVM that Oracle 9.2.1 throws down during its install.

Maybe I'll try to switch to the 10g driver? Seems like it would at least be worth a try.

Thanks for the help in any event.

Regards,
Dave Penn

"D Rolfe" <dwrolfeFRUITBAT_at_orindasoft.com> wrote in message news:41343856.3020808_at_orindasoft.com...
>
>
> Dave,
> > Here's one for you experts:
> >
> > I have a 9i release 2 db set up, to which I connect via the JDBC thin
> > driver. I have a JavaServer Pages application that needs to read a
VARRAY
> > from a table and then use the contents of the VARRAY. Here's the code
in
> > the JSP that does that:
> >
> > resultset=db.executeQuery
> > ("SELECT IMAGE_lIST FROM PAGE_IMAGE_ARRAY WHERE PAGENAME = " +
> > pagename);
> >
> > oracle.sql.ARRAY array =
> > ((oracle.jdbc.driver.OracleResultSet)resultset).getARRAY(1);
> > imageList = (String[])array.getArray();
> > for(int count=0; count<imageList.length; count++)
> > {
> > out.println("<p>The image at position " + count + " in the array
is
> > the image titled: " + imageList[count]);
> > }
> >
> > The JSP compiles and runs fine, but the output is as follows:
> >
> > The image at position 0 in the array is the image titled: 0x7465737431
> > The image at position 1 in the array is the image titled: 0x7465737432
> >
> > The image at position 2 in the array is the image titled: 0x7465737433
> >
> > The image at position 3 in the array is the image titled: 0x7465737436
> >
>
> We've recently seen this kind of odd behaviour. It occurs with Arrays,
> Eclipse and the 9i driver. Are you by any chance using Eclipse 3.0? What
> underlying JVM is in use? What's odd is that the same code and driver
> runs fine outside Eclipse.
>
> FYI It went away when we started to use the 10g JDBC driver.
>
> David Rolfe
> Orinda Software
> Dublin, Ireland
> www.orindasoft.com
>
> -------------------------------------------------------------------
> Orinda Software make OrindaBuild, which writes JDBC calls for PL/SQL
>
Received on Tue Aug 31 2004 - 06:44:51 CDT

Original text of this message

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