AnantLabs / xerial

Automatically exported from code.google.com/p/xerial
0 stars 0 forks source link

PreparedStatement doesn't throw BatchUpdateException (Statement does) #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. For example: table Customer (id INTEGER PRIMARY KEY, name varchar(255) not 
null, email varchar(50))
2. Using PreparedStatement insertStmt (INSERT INTO Customer values(?, ?, ?)) 
with bunch of datas (ex: 1, A, a@a.com  2, null, b@b.com)
3. Call insertStmt.addBatch()
4. Finally call insertStmt.executeBatch()
5. It should throw exception (that's OK) but that exception is not 
BatchUpdateException - it is SQLException (I checked the source code of 
Stmt.java and PrepStmt.java, in Stmt.executeBatch() it catches SQLException and 
throws BatchUpdateException - this behaviour is correct. But in PrepStmt it 
doesn't)

What is the expected output? What do you see instead?
PrepStmt.executeBatch() should throw UpdateBatchException (currently it doesn't)

What version of the product are you using? On what operating system?
sqlitejdbc-v056.jar on Windows XP SP3

I hope I have explained the bug clearly.

Original issue reported on code.google.com by luan.bui...@googlemail.com on 3 Nov 2010 at 7:28