dbTalk Databases Forums  

addBatch and executeUpdate should throw an exception?

mailing.database.mysql-java mailing.database.mysql-java


Discuss addBatch and executeUpdate should throw an exception? in the mailing.database.mysql-java forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kevin A. Burton
 
Posts: n/a

Default addBatch and executeUpdate should throw an exception? - 07-28-2004 , 02:34 PM






Just an idea... not sure if this breaks the JDBC spec.

If you call addBatch() on a PreparedStatement... then call
executeUpdate... instead of executeBatch... shouldn't it throw an Exception.

Either that or if profileSql=true then it should log a warning.

Kevin

--

Please reply using PGP.

http://peerfear.org/pubkey.asc

NewsMonster - http://www.newsmonster.org/

Kevin A. Burton, Location - San Francisco, CA, Cell - 415.595.9965
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412
IRC - freenode.net #infoanarchy | #p2p-hackers | #newsmonster


--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=my...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Mark Matthews
 
Posts: n/a

Default Re: addBatch and executeUpdate should throw an exception? - 07-28-2004 , 05:53 PM






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

Kevin A. Burton wrote:

Quote:
Just an idea... not sure if this breaks the JDBC spec.

If you call addBatch() on a PreparedStatement... then call
executeUpdate... instead of executeBatch... shouldn't it throw an
Exception.

Either that or if profileSql=true then it should log a warning.

Kevin

Neither is required by the JDBC spec. We'll look at adding this to the
'usageAdvisor' feature as a warning, but there should be absolutely
nothing wrong with calling executeUpdate() before executeBatch(), unless
that's not what _you_ wanted to do (i.e. an application-level error).

Regards,

-Mark

- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 332 0507
www.mysql.com

MySQL Guide to Lower TCO
http://www.mysql.com/it-resources/white-papers/tco.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBCC5OtvXNTca6JD8RAqA5AKCpuD19EO9gaRxnN+jEet /BpqOasQCeIMqO
mhGyYP/IKBdrhMbjNhOD9YU=
=kX9E
-----END PGP SIGNATURE-----

--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=my...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.