Bug #4933 warn about whitespaces in colum names
Submitted: 6 Aug 2004 15:18 Modified: 2 Dec 2008 16:27
Reporter: Ralf Hauser Email Updates:
Status: Won't fix Impact on me:
None 
Category:Connector / J Severity:S4 (Feature request)
Version:any OS:Any (any)
Assigned to: CPU Architecture:Any

[6 Aug 2004 15:18] Ralf Hauser
Description:
by copy paste, my eclipse got a field name
"login " into my db servlet.
This caused an unknown column exception.

Assuming that whitespaces are not allowed in crs.getString("colum_name"), it would be great to alert the programmer about this!

How to repeat:
obvious

Suggested fix:
in case of the exception thrown, it would be great to warn

if (columName.length != columName.trim().length) {
	log.debug("Your column name \""+columName+"\" contains " +
		(columName.length - columName.trim().length) +
		" illegal white space characters - please fix");
}

this will not alter the runtime of a correct program and also, it doesn't appear to inflate the jar size excessively -
what do you think.
[2 Dec 2008 16:27] Tonci Grgin
Ralf, for something that is called for each column of every resultset row this would be just too much. There is no substance to support this feature request moreover since it's not illegal to have whitespace in column name. Just as with any typo, you get a nicely formatted error like in your case.