16 messages in com.mysql.lists.javaRe: setting nulls in prepared statement| From | Sent On | Attachments |
|---|---|---|
| Twibell, Cory L | 08 Jul 2003 10:26 | |
| Twibell, Cory L | 09 Jul 2003 07:58 | |
| Pierre Awaragi | 09 Jul 2003 08:14 | |
| Twibell, Cory L | 09 Jul 2003 08:18 | |
| col...@dreamwerx.net | 09 Jul 2003 08:25 | |
| col...@dreamwerx.net | 09 Jul 2003 08:27 | |
| Pierre Awaragi | 09 Jul 2003 08:35 | |
| Jeff Mathis | 09 Jul 2003 08:41 | |
| Twibell, Cory L | 09 Jul 2003 08:42 | |
| Twibell, Cory L | 09 Jul 2003 08:46 | |
| Dane Foster | 09 Jul 2003 08:49 | |
| Marc Slemko | 09 Jul 2003 09:14 | |
| Keith Hatton | 09 Jul 2003 09:17 | |
| Paul DuBois | 09 Jul 2003 09:20 | |
| Twibell, Cory L | 09 Jul 2003 09:25 | |
| Jeff Mathis | 09 Jul 2003 09:34 |
| Subject: | Re: setting nulls in prepared statement![]() |
|---|---|
| From: | Jeff Mathis (jmat...@predict.com) |
| Date: | 07/09/2003 08:41:16 AM |
| List: | com.mysql.lists.java |
If you run a query from the mysql command line, I think you'll find that mysql really doesn't allow 'NULL'. It takes on a default value of 0 for ints. varchars look like they can have NULL, but I'm not really sure about this. mysql does not behave like oracle or sybase regarding nulls (i'm not taking a pro or con position on this...)
In any event, we work around this issue. For select statements, I call ResultSet.wasNull() to see if a column really was null.
"Twibell, Cory L" wrote:
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?
Cory Twibell Lockheed Martin Space Systems Company Electronic Combat Development Systems cory...@lmco.com (303) 971-3184
-- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java?unsub=cory...@lmco.com
-- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java?unsub=jmat...@predict.com
-- Jeff Mathis, Ph.D. 505-955-1434 The Prediction Company jmat...@predict.com 525 Camino de los Marquez, Ste 6 http://www.predict.com Santa Fe, NM 87505




