Re: Possible Bug in Informix JDBC Driver with use of addBatch() with BigDecimal
Posted in 2007
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration, Java & JDBC Development
Zachi wrote: > > ResultSet r = ..."select field1, field2,...money_field,... from tab1 > where..."; > PreparedStatement p = ..."insert into tab2 (field1, > field2,...money_field,...) values (?,?,...?,...)"; > > //implicit NULL setting - inserts non-null values > while (r.hasNext()) { > ... > p.setBigDecimal(i,r.getBigDecimal(i)); > ... > p.addBatch(); > } > p.submitBatch(); What is submitBatch()? It's not a standard JDBC method. -- Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) ============================================================== * The Ultimate DBMS is here! * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
On Apr 27, 2:12 pm, Lee Fesperman <first...@ix.netcom.com> wrote: > Zachi wrote: > > > ResultSet r = ..."select field1, field2,...money_field,... from tab1 > > where..."; > > PreparedStatement p = ..."insert into tab2 (field1, > > field2,...money_field,...) values (?,?,...?,...)"; > > > //implicit NULL setting - inserts non-null values > > while (r.hasNext()) { > > ... > > p.setBigDecimal(i,r.getBigDecimal(i)); > > ... > > p.addBatch(); > > } > > p.submitBatch(); > > What is submitBatch()? It's not a standard JDBC method. > > -- > Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) > ============================================================== > * The Ultimate DBMS is here! > * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) submitBatch(), as well as its brothers addBatch(), executeBatch() and clearBatch() are part of the java.sql.Statement , which has been part of the standard since 1.4.2 (if not earlier). This is an interface to allow sending a batch of commands to be executed, instead of sending them one at a time, which allows for much higher performance due to eliminating a lot of roundtrips. Zachi
On 27 Apr, 22:48, Zachi <zklop...@gmail.com> wrote: > On Apr 27, 2:12 pm, Lee Fesperman <first...@ix.netcom.com> wrote: > > > > > > > Zachi wrote: > > > > ResultSet r = ..."select field1, field2,...money_field,... from tab1 > > > where..."; > > > PreparedStatement p = ..."insert into tab2 (field1, > > > field2,...money_field,...) values (?,?,...?,...)"; > > > > //implicit NULL setting - inserts non-null values > > > while (r.hasNext()) { > > > ... > > > p.setBigDecimal(i,r.getBigDecimal(i)); > > > ... > > > p.addBatch(); > > > } > > > p.submitBatch(); > > > What is submitBatch()? It's not a standard JDBC method. > > > -- > > Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) > > ============================================================== > > * The Ultimate DBMS is here! > > * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) > > submitBatch(), as well as its brothers addBatch(), executeBatch() and > clearBatch() are part > of the java.sql.Statement , which has been part of the standard since > 1.4.2 (if not earlier). This is an interface to allow sending a batch > of commands to be executed, instead of sending them one at a time, > which allows for much higher performance due to eliminating a lot of > roundtrips. > > Zachi- Hide quoted text - > > - Show quoted text - Log a bug with IBM.
Zachi wrote: > On Apr 27, 2:12 pm, Lee Fesperman <first...@ix.netcom.com> wrote: >> Zachi wrote: >> >>> ResultSet r = ..."select field1, field2,...money_field,... from tab1 >>> where..."; >>> PreparedStatement p = ..."insert into tab2 (field1, >>> field2,...money_field,...) values (?,?,...?,...)"; >>> //implicit NULL setting - inserts non-null values >>> while (r.hasNext()) { >>> ... >>> p.setBigDecimal(i,r.getBigDecimal(i)); >>> ... >>> p.addBatch(); >>> } >>> p.submitBatch(); >> What is submitBatch()? It's not a standard JDBC method. >> >> -- >> Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) >> ============================================================== >> * The Ultimate DBMS is here! >> * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) > > submitBatch(), as well as its brothers addBatch(), executeBatch() and > clearBatch() are part > of the java.sql.Statement , which has been part of the standard since > 1.4.2 (if not earlier). This is an interface to allow sending a batch > of commands to be executed, instead of sending them one at a time, > which allows for much higher performance due to eliminating a lot of > roundtrips. submitBatch isn't listed in the API docs for java.sql.Statement in Java 1.4.2 or 1.5.0 or 1.6.0 The only batch methods listed are addBatch, clearBatch and executeBatch. Perhaps submitBatch is some kind of non-standard extension in the Informix driver? David Harper Cambridge, England
On Apr 28, 5:37 am, David Harper <devn...@obliquity.u-net.com> wrote: > Zachi wrote: > > On Apr 27, 2:12 pm, Lee Fesperman <first...@ix.netcom.com> wrote: > >> Zachi wrote: > > >>> ResultSet r = ..."select field1, field2,...money_field,... from tab1 > >>> where..."; > >>> PreparedStatement p = ..."insert into tab2 (field1, > >>> field2,...money_field,...) values (?,?,...?,...)"; > >>> //implicit NULL setting - inserts non-null values > >>> while (r.hasNext()) { > >>> ... > >>> p.setBigDecimal(i,r.getBigDecimal(i)); > >>> ... > >>> p.addBatch(); > >>> } > >>> p.submitBatch(); > >> What is submitBatch()? It's not a standard JDBC method. > > >> -- > >> Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com) > >> ============================================================== > >> * The Ultimate DBMS is here! > >> * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com) > > > submitBatch(), as well as its brothers addBatch(), executeBatch() and > > clearBatch() are part > > of the java.sql.Statement , which has been part of the standard since > > 1.4.2 (if not earlier). This is an interface to allow sending a batch > > of commands to be executed, instead of sending them one at a time, > > which allows for much higher performance due to eliminating a lot of > > roundtrips. > > submitBatch isn't listed in the API docs for java.sql.Statement in Java > 1.4.2 or 1.5.0 or 1.6.0 > > The only batch methods listed are addBatch, clearBatch and executeBatch. > > Perhaps submitBatch is some kind of non-standard extension in the > Informix driver? > > David Harper > Cambridge, England Sorry, my mistake. submitBatch() was a wrapper for executeBatch() in my original code.