File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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.
I agree. Here's the link:
subject: NULL value
It's not a secret anymore!