wood burning stoves 2.0
The moose likes JDBC and Relational Databases 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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "NULL value" Watch "NULL value" New topic

NULL value

Arjun Reddy
Ranch Hand

Joined: Nov 10, 2007
Posts: 629

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: 629
Thanks David.
wood burning stoves
subject: NULL value
jQuery in Action, 3rd edition