HI, I have table data I'm trying to read . However one column is populated with the word "null".
I guess java does not like dealing with the word null and throws errors.
when I try a block like
if ( rsrow.getString(insCol) = "null") {
I get and error .
If I try :
| | | | | cmp = rsrow.getString(insCol); |
If I try:If I try:
if (cmp = "null") {
I get an error
If I try to use a replace function like:
System.out.println(cmp.replace("null", "0"));
just to see if replace works I get and error.
What id the BEST way to replace this string value with something like "0" when I come across it with out jave throwing an error?
I want it such that every time I come across the word "null" I can repalce it with "0".
Something like:
| | | | | if (rsrow.getString(insCol) = "null") { | | | |
| | | | | | | |
| | | | | | | | rowofdata = rowofdata + "'0',"; |
| | | | | } else { | | | |
| | | | | | | | rowofdata = rowofdata + "'" + rsrow.getString(insCol) + "',"; |
| | | | | } | | | |
Thanks,