You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gergely Imre <gi...@nextra.ro> on 2000/09/30 18:21:58 UTC

Please, help me :-(

Somebody please tell me, what's wrong with that:

<?xml version="1.0"?>
 
<?cocoon-process type="xsp"?>
 
<xsp:page language="java"
          xmlns:sql="http://www.apache.org/1999/SQL"
          xmlns:xsp="http://www.apache.org/1999/XSP/Core">
 
<page>
  <sql:execute-query>
    <sql:driver>org.gjt.mm.mysql.Driver</sql:driver>
    <sql:dburl>jdbc:mysql://foo.com/accounting</sql:dburl>
    <sql:username>root</sql:username>
    <sql:doc-element>ROWSET</sql:doc-element>
    <sql:row-element>ROW</sql:row-element>
    <sql:query>select 10.0 as alma</sql:query>
  </sql:execute-query>
</page>
 
</xsp:page> 


I get the error:

>>>
java.lang.ArrayIndexOutOfBoundsException: 4
>>>

I know, I know this is a Java error, but if I try with the query:

<sql:query>select 10 as alma</sql:query>

it works.
What could be wrong?
Thanx

--
GImre 
-> ICQ# 86297366

Re: Please, help me :-(

Posted by Andreas Popper <an...@gmx.de>.
Hi!

I'm not the java Expert, but

an Arry Index must be of data type 'integer',

I presume.

geronimo


Re: Please, help me :-(

Posted by Donald Ball <ba...@webslingerZ.com>.
On Sat, 30 Sep 2000, Gergely Imre wrote:

> <page>
>   <sql:execute-query>
>     <sql:driver>org.gjt.mm.mysql.Driver</sql:driver>
>     <sql:dburl>jdbc:mysql://foo.com/accounting</sql:dburl>
>     <sql:username>root</sql:username>
>     <sql:doc-element>ROWSET</sql:doc-element>
>     <sql:row-element>ROW</sql:row-element>
>     <sql:query>select 10.0 as alma</sql:query>
>   </sql:execute-query>
> </page>
> 
> I get the error:
> 
> >>>
> java.lang.ArrayIndexOutOfBoundsException: 4
> >>>
> 
> I know, I know this is a Java error, but if I try with the query:
> 
> <sql:query>select 10 as alma</sql:query>
> 
> it works.
> What could be wrong?

obviously some problem with getting the column value when it's cast as a
real number rather than an integer. where it's creeping in? i have no
clue, sorry. if you want to try to fix it, i'm sure it's cropping up in
the XSPSQLLibrary java class. i've entirely restructured the way results
are retrieved in the new esql logicsheet, so i'm really not likely to take
the time to track this down but rather spend it finalizing esql. suggest
you either cast the real to an integer using some sql method or give esql
a whirl.

- donald