This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem with Inserting Value in Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with Inserting Value in Database" Watch "Problem with Inserting Value in Database" New topic
Author

Problem with Inserting Value in Database

Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 86
I'm trying to insert some data into a database with the following piece of code. When the street address is null, I get an error message saying that the system could not get the property 'streetAddress'. It looks like it is not allowing me to insert a null value into the database. If the street address is null, how can I insert a null value into the database.

<insert id="insertMyFile"
parameterClass="com.test.MyClass">
insert into MYTABLE (COLUMN1, COLUMN2, COLUMN3, COLUMN4) values
(#firstName:CHAR#, #lastName:CHAR#, #streetAddress:CHAR#, #emailAddress:CHAR#)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with Inserting Value in Database