Hello,
I guess you might have this issue with other JDBC drivers too (not sure).
Anyway, my general solution to your problem would be :
boolean addedToBatch = false;
while (loop condition)
if (need to add to batch)
{
add to batch
addedToBatch = true;
}
}
if (addedToBatch)
{
execute batch
}
> I am having an issue with the Informix JDBC driver and wondering if anyone
> else has it or has a solution to my problem. I have a method that fills a
[quoted text clipped - 10 lines]
> java.lang.NullPointerException
> at
com.informix.jdbc.IfxPreparedStatement.executeBatch(IfxPreparedStatement.jav
> a:3070)
> at ImportServices.CmptrImport.processItem(CmptrImport.java:258)
[quoted text clipped - 10 lines]
>
> Mel Haynes Jr
Mel Haynes Jr - 24 Sep 2003 00:02 GMT
Thanks for the suggestion. That is what I did.
I found out the problem. I changed the Insert statement to include a new
field, but forgot to add another setLong() to the preparedstatement. So it
returned the nullpointer statement. I don't think that exception is handled
very well. In the DataDirect driver, it would tell me that the parameters do
not match( like it should ). I guess thats the price I pay for using free
drivers.
> Hello,
>
[quoted text clipped - 29 lines]
> > java.lang.NullPointerException
> > at
com.informix.jdbc.IfxPreparedStatement.executeBatch(IfxPreparedStatement.jav
> > a:3070)
> > at ImportServices.CmptrImport.processItem(CmptrImport.java:258)
[quoted text clipped - 14 lines]
> >
> > Mel Haynes Jr
Clemens Anhuth - 24 Sep 2003 09:24 GMT
> Thanks for the suggestion. That is what I did.
>
[quoted text clipped - 4 lines]
> not match( like it should ). I guess thats the price I pay for using free
> drivers.
Mel,
providing drivers/connectivity for their own DB engines is certainly a
field with mixed choices here and there, depending on vendor.
Notify the vendor about this problem, maybe. If opensource, maybe go
into the sourcecode and take a look around, it may be easy to fix and
then be more helpful to you in the development cycle.
With best regards
Clemens Anhuth

Signature
---------------------------------------------------
Clemens Anhuth com.primebase @ clemens.anhuth
SNAP Innovation Softwareentwicklungs GmbH
22767 Hamburg
Altonaer Poststrasse 9a
Phone: ++49 (0)40 389 044 - 0 Fax: - 44
http://www.snap.de/ http://www.primebase.com/
---------------------------------------------------