db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dag.Wan...@Sun.COM (Dag H. Wanvik)
Subject Re: help me
Date Tue, 07 Oct 2008 02:15:58 GMT
Valentin Cozma <vcozma@elfyard.com> writes:

> 赵峰 wrote:
>> Apache Derby Network Server - 10.4.2.0
>> String sql="insert into test (id,name) value(1,?)";
>> PreparedStatement ps=con.prepareStatement(sql);
>> ps.setObject(1,null);
>> ps.executeUpdate()
>
>
> try something like this :
>
> ps.setNull(1, Types.Integer);

Yes, the error message says something like "type not supported" as far
as I can understand, so try to use the set<type> method of the <type>
for the column "name" - setString ?

Supporting this, in English locale, using ps.setObject(1,null) instead
of ps.setNull(1, Types.String) gave me this error message:

java.sql.SQLException: Type is not supported


Mime
View raw message