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] SQL Server null - Not implemented (type is java.sql.Types.OTHER)
Date Mon, 05 Jul 2004 18:02:40 GMT
It would be nice if every driver accepted null in setObject but I don't
think that's the case.  If we could find a common way to set null
parameters in DB2, Oracle, SQL Server, MySQL, and Postgres we could
implement fillStatement to use it.  Until then, the QueryRunner subclass
approach is the only solution.

David



--- "Rafael U. C. Afonso" <r.u.c.afonso@uol.com.br> wrote:
> Hello:
> 
> I had a problem like related by Henri
> Yandell (see
>
http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg42819.html),
> but instead use Oracle I am using SQL
> Server. When I try insert a Null
> parameter in a Insert Query I get this
> message: "Not implemented (type is
> java.sql.Types.OTHER)". I am using
> jTds driver, but MS official driver
> has the same problem (But does not
> explain about Types.Other).
> I read original Source of jTds and I
> see that this message above is thrown
> from a method called
> createParameterMapping() from
> ParameterUtils class. I don't
> understand why they made this, but
> anyway it is a problem from driver,
> not form QueryRunner.
> My solution was create a QueryRunner
> subclass, where I overridden
> fillStatement() method like this:
> 
>             if (params == null) {
>                 return;
>             }
> 
>             for(int i = 0; i <
> params.length; i++) {
>                 stmt.setObject(i + 1,
> params[i]);
>             }
> 
> I don't verify if current parameter is
> null or not. And this works.
> What do you think?
> 
> Thanks,
> 
> Rafael Ubiratam Clemente Afonso
> r.u.c.afonso@uol.com.br
> ---------------------------------
> Where is Debug?
> Debug is on the Table!
>  
>
__________________________________________________________________________
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - … grŠtis!
> http://antipopup.uol.com.br/
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
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