16 messages in com.mysql.lists.javaRE: setting nulls in prepared statement
FromSent OnAttachments
Twibell, Cory L08 Jul 2003 10:26 
Twibell, Cory L09 Jul 2003 07:58 
Pierre Awaragi09 Jul 2003 08:14 
Twibell, Cory L09 Jul 2003 08:18 
col...@dreamwerx.net09 Jul 2003 08:25 
col...@dreamwerx.net09 Jul 2003 08:27 
Pierre Awaragi09 Jul 2003 08:35 
Jeff Mathis09 Jul 2003 08:41 
Twibell, Cory L09 Jul 2003 08:42 
Twibell, Cory L09 Jul 2003 08:46 
Dane Foster09 Jul 2003 08:49 
Marc Slemko09 Jul 2003 09:14 
Keith Hatton09 Jul 2003 09:17 
Paul DuBois09 Jul 2003 09:20 
Twibell, Cory L09 Jul 2003 09:25 
Jeff Mathis09 Jul 2003 09:34 
Subject:RE: setting nulls in prepared statement
From:Twibell, Cory L (cory@lmco.com)
Date:07/09/2003 08:18:14 AM
List:com.mysql.lists.java

Yes, I have tried those, it didn't work. What's the BEST setNull method to use for parameters that you have no knowledge of their data type?

Have you tried ps.setNull(index, Types.INTEGER) or ps.setNull(index, Types.VARCHAR)

Anyone??????

-----Original Message----- From: Twibell, Cory L [mailto:cory@lmco.com] Sent: Tuesday, July 08, 2003 11:27 AM To: 'ja@lists.mysql.com' Subject: setting nulls in prepared statement

All,

Using MySQL4.1.0-alpha, Connect/J3.1 nightly 20030613

Have a table with a varchar and integer as NULL. Using a prepared statement, I can't seem to get "null" into the table. It's currently putting 0 for my integer. I've tried setNull( index, Types.NULL ), setObject( index, null ), setString( index, "null" )....and any combination I can think of.

My prepared statement is built dynamically, with the parameters coming in as a Vector of OBJECTs, so I wont know the data type of the parameter.

Anyone have any suggestions?