I'm really no Java guru but maybe I've found a bug in the esql logicsheet?

That's what I do in my xsp page using the esql logicsheet:

<esql:execute-query>
 <!--<esql:max-rows>50</esql:max-rows>-->
 <esql:query>SELECT DISTINCT HSNName FROM TabKFZ</esql:query>
 <esql:results>
  <results>
   <esql:row-results>
    <item><esql:get-string column="HSNName"/></item>
   </esql:row-results>
  </results>
 </esql:results>
</esql:execute-query>


I wrote a test class to check if I get the same problems using java directly. So this is the code:



public class Test {
public static void main(String[] args) throws ClassNotFoundException {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url= new String("jdbc:odbc:wktkl");
Connection con;
try {
con = DriverManager.getConnection(url);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("SELECT DISTINCT HSNName FROM TabKFZ");
while (rs.next()) {
System.out.print(rs.getString("HSNName") + "\n");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}


The Java class gives the correct result but the esql breaks with the exception see below.

If I use the esql:max-rows element within my xsp page (see comment above) and gives it a value beneath the expected maximum rows I get no exception. If I set esql:max-rows to a value above the maximum rows of the sql result, the same exception is thrown.

Can somebody comment this behavior?

Markus


Markus Heussen schrieb:

Hi.

I changed my application from Cocoon-2.0.4 under SDK 1.3.2 to Cocoon-2.1.5.1 and SDK 1.4.2. Without changing anything in my code now I have problems accessing an access db using the esql logicsheet. Somebody there who can help me resolving this problem?

The following exception occurs when I use the esql logicsheet for accessing an microsoft access database using SUN's sun.jdbc.odbc.JdbcOdbcDriver bridge. This exception occurs only if I use the DISTINCT or GROUP BY sql statements.

org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate(): org.apache.avalon.framework.CascadingRuntimeException: Error getting ascii data for column HSNName

cause: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Ung�ltiger Cursorstatus (this is german for "invalid cursor state")

Original Exception: org.apache.avalon.framework.CascadingRuntimeException: Error getting ascii data for column HSNName
at org.apache.cocoon.components.language.markup.xsp.EsqlHelper.getAscii(EsqlHelper.java:270)


at org.apache.cocoon.www.matrix.areas._050.xsp.enter_level_4_gen_xsp.generate(org.apache.cocoon.www.matrix.areas._050.xsp.enter_level_4_gen_xsp:1502)



Thanks for all responses, Markus :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to