-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

l'eau wrote:
>  
> Using MySql Connect/J (mysql-connector-java-3.1.7.tar)
> on Linux Fedora 2.
> 
> I use a Statement object and do the following query:
> 
> String myquery = "SELECT * FROM term WHERE name REGEXP (\'"+ name 
>                 +"\') and term_type=\'"+ ontology +"\'  LIMIT 20";  
> table term has 6 columns.
> 
> MySql connect/J use 700mB to retrieve hundreds of rows when it should 
> retrieve 
> only 20. Actually it crashes with:
> Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap 
> space
> Exception on Toolkit thread: java.lang.OutOfMemoryError: Java heap space
> java.lang.OutOfMemoryError: Java heap space
> 
> Is LIMIT supported with the JDBC driver?
> thank you everygody
> Laurie
> 

Laurie,

Yes, the driver supports the 'LIMIT' keyword, because it relies on the
server to do it (the driver does not rewrite queries or really do any
processing on queries, other than sending them to the server, and
preparing the results to be treated like java.sql.ResultSets).

If the driver is reading 100's of megabytes of rows, it's because the
server is sending them. What happens if you run the _exact_ same query
in the MySQL commandline client?

        -Mark

- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com

MySQL User Conference (Santa Clara CA, 18-21 April 2005)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCSvtEtvXNTca6JD8RAqEtAKDHWTmillMzO7fPoHzxI8HH9tCSbgCgnV5D
A0lyMaCMhzs+zhx+tbL2EBs=
=PVeS
-----END PGP SIGNATURE-----

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to