4 messages in com.mysql.lists.javaRe: setFetchSize()| From | Sent On | Attachments |
|---|---|---|
| Israel Olalla | 18 Sep 2002 05:03 | |
| Mark Matthews | 18 Sep 2002 05:53 | |
| Israel Olalla | 18 Sep 2002 06:57 | |
| Mark Matthews | 18 Sep 2002 08:55 |
| Subject: | Re: setFetchSize()![]() |
|---|---|
| From: | Mark Matthews (ma...@thematthews.org) |
| Date: | 09/18/2002 05:53:58 AM |
| List: | com.mysql.lists.java |
This logic is actually required to be JDBC-compliant. Sun's testsuite tests for this logic in all drivers.
-Mark
----- Original Message ----- From: "Israel Olalla" <isra...@newknow.com> To: <ja...@lists.mysql.com> Sent: Wednesday, September 18, 2002 7:03 AM Subject: setFetchSize()
Hi Mark,
I am using mysql-conneector-java-3.0.0 and i've detected that setFechtSize doesn't work as should. It tests if rows are bigger than the number of rows of this Statement and is shouldn't care, what should be chequed is if this.getMaxRows() is smaller or equals instead of bigger is rows is smaller then should limit the number of rows instead of throwing an exception. The curios thing is that in he javadoc is ok, but in the code isn't :-)
The solution should be to set rows as <= instead of >.
Send you the change, if you prefer i can send you a diff.
Thanks for the great work you've done with mysql.
------------------------------------------------------------ public void setFetchSize(int rows) throws SQLException { if (rows <= this.getMaxRows() || (rows < 0 && rows != Integer.MIN_VALUE)) { throw new SQLException("Illegal value for setFetchSize()", "S1009"); } fetchSize = rows; }
---------------------------------------------------------------- Hope it helps.
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail java...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java...@lists.mysql.com instead.




