cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enke, Michael" <michael.e...@wincor-nixdorf.com>
Subject Re: _esql_connection.connection should be public
Date Tue, 13 May 2003 11:53:00 GMT
Christian Haul wrote:
> 
> On 12.May.2003 -- 02:32 PM, Enke, Michael wrote:
> > Torsten Curdt wrote:
> > >
> > > > IMHO a new esql tag would be the best.
> > > > If we make it outside esql we have to care about all imports and try/catch
> > > > and what else is realted to java.sql.* in the xsp. This is not necessary
when
> > > > we make it with esql.
> > > > If we create a new tag for returning the connection, I propose also to
create a tag
> > > > for returning a ResultSet and ResultSetMetaData.
> > > > Than we have more freedom in manipulating/assigning all kind of DB related
data.
> > >
> > > not sure if ResultSet and ResultSetMetaData is really necessary but...
> > > care enough for a patch? ;-)
> >
> > for variable asignment like:
> >
> > double d[] = new doubel[<esql:get-column-count/>];
> > for(int i=0;i<d.length;i++) d[i] = _esql_query.getResultSet().getDouble(i+1);
> >
> > I can not say: d[i] = <esql:get-double><xsp:attribute name="column"><xsp:expr>i</xsp:expr></xsp:attribute></esql:get-double>
> >
> > Or can I?
> 
> Yes, you can:
> 
>   d[i] = <esql:get-double><esql:column><xsp:expr>i</xsp:expr></esql:column></esql:get-double>
> 

Hi Chris,
my code is (inside <xsp:logic>) now

double d = <esql:get-double><esql:column><xsp:expr>i+1</xsp:expr></esql:column></esql:get-double>;

This doesn't work. I see:
Failed to generate program code (this may happen if you use Xalan in incremental processing
mode).
Please check log file and/or console for errors.

and in console:
java.lang.RuntimeException: Stylesheet führte zu Beendigung
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3363)
        at java.lang.Thread.run(Thread.java:536)

Also if I set incremental-processing to false I get this error:
Stylesheet führte zu Beendigung

But nevertheless, I started this thread because I need the connection inside xsp.
In esql.xsl, there is a tag esql:get-connection:
<xsl:template match="esql:connection/esql:get-connection">
  <xsp:expr>_esql_connection</xsp:expr>
</xsl:template>

This is probably an error and should read correctly:
<xsl:template match="esql:connection//esql:get-connection">
  <xsp:expr>_esql_connection.connection</xsp:expr>
</xsl:template>
(two slashes and .connection)
but for this too, connection in Cocoon2EsqlConnection has to be public
or it should call a getter method.

Michael

Mime
View raw message