Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes Missing column 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 "Missing column" Watch "Missing column" New topic

Missing column

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Hi friends,
I am using JSP and AJAX to display reports in my Web Application.... I had 17 fields in my table..The problem is one field has all the 17 columns and other one has not, it contains some null values too...When i try to display the record which has some NULL fields,instead of displaying as NULL as output, the column just wont appeared, ie.. just a blank white space there...Whats the problem.
Below content was edited :

Never try to be a hard-worker. Be a smart-worker.
My Blog
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3902

If you have created the fields to have null values and if you don't insert anything in the previous insert statements you won't get anything most probably. Have you tried this sql directly against the database to see what it outputs? Any way to have database access code in JSP seems very bad design.
[ November 12, 2008: Message edited by: Vijitha Kumara ]

[How to ask questions] [Twitter]
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
Also, you are constructing an sql query using string concatenation. It can lead to SQL injection attacks. Always use PreparedStatement for executing sql queries.
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Thanks for your replies..It works now!!!
I agree. Here's the link:
subject: Missing column
It's not a secret anymore!