[prev in list] [next in list] [prev in thread] [next in thread] 

List:       odtug-java-l
Subject:    RE: Null Integer to insert into an Oracle number optional column
From:       "VJaen" <MRXP-TVJ () pancanal ! com>
Date:       2003-11-13 21:29:20
[Download RAW message or body]

Thanks a lot Steve!

-----Original Message-----
Sent: Thursday, November 13, 2003 3:54 PM
To: Multiple recipients of list ODTUG-JAVA-L
column


Setting nulls is the same for all types. You just need to pick the right contstant in \
the java.sql.Types class to pass as the 2nd argument to the setNull() so that it \
knows what type of data that bind variables is supposed to be. 


Steve Muench - Developer, Product Mgr, Java/XML Evangelist, Author - Oracle
http://radio.weblogs.com/0118231/
-----Original Message-----
Sent: Thursday, November 13, 2003 20:54
To: Multiple recipients of list ODTUG-JAVA-L

Great!  Thanks Steve.
I haven't tried with null Dates objetcs yet, is this similar to Integer or String?

Thanks!  

-----Original Message-----
Sent: Thursday, November 13, 2003 11:34 AM
To: Multiple recipients of list ODTUG-JAVA-L column


Victor,

Use setNull(xxx, java.sql.Types.INTEGER) instead of setInt(xxx,null) 


Steve Muench - Developer, Product Mgr, Java/XML Evangelist, Author - Oracle \
http://radio.weblogs.com/0118231/ -----Original Message-----
Sent: Thursday, November 13, 2003 16:59
To: Multiple recipients of list ODTUG-JAVA-L

Hello gurus!

I need to insert some rows from java to Oracle, the table structure have NUMBER, and \
VARCHAR2 optional columns.

I receive Integer and String objects to be inserted into the NUMBER, and VARCHAR2 \
optional columns. Two things here:
	1. For Integer objects, to use the PreparedStatment.setInt method I have to use \
myInteger.intValue() method to convert the Integer to an int first. Right?

	2. When an Integer is null I get a java.lang.NullPointerException when I try to use \
setInt method.  Is there any way to handle this or I have to initialize all null \
Integers with zero values and treat them as null in my PL/SQL program?

Any help will be appreciated!

TIA.

===========================
Victor R. Jaen G.
Panama Canal Authority
E-Mail: vjaen@pancanal.com
===========================
--
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
--
Author: VJaen
  INET: MRXP-TVJ@pancanal.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, \
include a line containing: UNSUB ODTUG-JAVA-L (or the name of mailing list you want \
to be removed from).  You may also send the HELP command for other information (like \
subscribing).

--
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
--
Author: Steve Muench
  INET: Steve.Muench@oracle.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, \
include a line containing: UNSUB ODTUG-JAVA-L (or the name of mailing list you want \
to be removed from).  You may also send the HELP command for other information (like \
                subscribing).
--
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
--
Author: VJaen
  INET: MRXP-TVJ@pancanal.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, \
include a line containing: UNSUB ODTUG-JAVA-L (or the name of mailing list you want \
to be removed from).  You may also send the HELP command for other information (like \
subscribing).

-- 
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
-- 
Author: Steve Muench
  INET: Steve.Muench@oracle.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ODTUG-JAVA-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Thanks to everyone for making ODTUG 2003 a great success!  See you in 2004!
If you want to volunteer for a committee, visit http://www.odtug.com
-- 
Author: VJaen
  INET: MRXP-TVJ@pancanal.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ODTUG-JAVA-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic