hi,
I have tried the LIMIT keyword with MySQL database and I get an exception.
Any Ideas? Thanks for any help.

String oql =
        "SELECT v " +
        "FROM <package>.MyClass v " +
        "LIMIT $1, $2 ";

OQLQuery query = db.getOQLQuery(oql);
query.bind(5);
query.bind(10);

java.lang.ArrayIndexOutOfBoundsException
        at
org.gjt.mm.mysql.PreparedStatement.set(PreparedStatement.java:1192)
        at
org.gjt.mm.mysql.PreparedStatement.setInt(PreparedStatement.java:484)

        at
org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:9
52)
        at
org.exolab.castor.jdo.engine.SQLEngine$SQLQuery.execute(SQLEngine.jav
a:1581)
        at
org.exolab.castor.persist.TransactionContext.query(TransactionContext
.java:644)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:4
58)
        at
org.exolab.castor.jdo.engine.OQLQueryImpl.execute(OQLQueryImpl.java:4

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 19, 2002 9:45 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] How LIMIT the fetched count of rows with JDO


On Tue, Jun 18, 2002 at 02:13:46PM -0600, Bruce Snyder wrote:
> 
> Castor JDO does provide support for the LIMIT keyword. Here is an example
of it's use:
> 
>     productOql = db.getOQLQuery( "SELECT p FROM myapp.Product p LIMIT $1,
$2" );
>     productOql.bind( 1 );
>     productOql.bind( 2 );
> 
> I hope this helps.

Yes, it does, thank you very much Bruce.

> 
> Bruce
> --
> 
> perl -e 'print
unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

Torsten

;-)
perl -e 'print unpack("u30","15\&\]R<W1E\;B\!38VAR\]F1E<\@H\");'

> 
> ----------------------------------------------------------- 
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 6/13/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.371 / Virus Database: 206 - Release Date: 6/13/2002
 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to