Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: NULL value