commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [DbUtils] Handling null values during an update
Date Tue, 07 Jun 2005 23:23:28 GMT
In the latest nightly builds, QueryRunner.fillStatement() uses
Types.VARCHAR to set columns to NULL:
http://jakarta.apache.org/commons/dbutils/xref/org/apache/commons/dbutils/QueryRunner.html#118

If you are using DbUtils 1.0, try a nightly build.  If you're already
using the latest code and it still fails, subclass QueryRunner and
override fillStatement() with the appropriate behavior.

David


--- Alfredo Ledezma Melendez <alfredo.ledezma@mail.telcel.com> wrote:

> Hello,
> 
> I've been using dbutils with mysql, postgresql, even with SQL Server
> successfully for quite a long time. But now I'm facing a little problem
> with
> Oracle9i (thin-driver and jdbc-odbc). I have a table with two fields of
> type
> DATE; when I try to UPDATE a row using methos update from QueryRunner in
> this
> table using null values, it throws the exception:
> java.sql.SQLException: Invalid column type Query: UPDATE factura SET
> fechaFacturacion = ?, fechaPedido = ? WHERE folioECAC = ? Parameters:
> [null,
> null, 278]
> However, using not null values it runs perfect. I've been looking in
> some forums
> and they say the problem is that driver does not how to set null values
> for
> those values of the table. Is there any workaround, somebody has solved
> this
> problem before, should I use PreparedStatement instead of QueryRunner?
> 
> Any help would be really appreciated.
> 
> Best regards,
> ____________________________________________
> Alfredo Ledezma Meléndez.
> Gerencia de Sistemas CRM
> Consultor Externo de Sistemas de Atención a Clientes
> RadioMovil DIPSA, S. A. de C. V.
> Ejército Nacional No. 488, Col. Anahuac, C.P. 11570
> México D.F.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


Get Firefox!
http://www.mozilla.org/firefox/


		
__________________________________ 
Discover Yahoo! 
Stay in touch with email, IM, photo sharing and more. Check it out! 
http://discover.yahoo.com/stayintouch.html

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message