This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes NULL value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "NULL value" Watch "NULL value" New topic

NULL value

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627

I was wondering how to insert a NULL value into a Database?

I did this,insert into tablename values('NULL'); and thought that it was correct until my friend showed me a table which had blank space. How did he have a table with a blank space?

Is null(unknown) value represented as a blankspace in a table or as NULL or as null?


Be Humble... Be Nice.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

'NULL' is inserting the String NULL
null will insert a null value
'' will insert an empty String

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 627
Thanks David.
I agree. Here's the link:
subject: NULL value
Similar Threads
Checking string
iReport Help
char array
comparing timestamp object to null
Null or blank String into database