In VB, I would have used an iif statment to test the column for null, and if it is to return an empty string.
[ June 27, 2002: Message edited by: Michael Brewer ]
Originally posted by Bosun Bello:
Try getObject. I believe that should allow you to retrieve nulls. You can then test if it's actually null after that.
OK, getObject sounds good. I should then test for null and cast it to a String, right? The only problem is I'm not only a greenhorn on this site, but also when it comes to Java. How do I test the object for null?
Originally posted by Jamie Robertson:
It must be incompatablility between the getString() method and your nVarchar column type. It should say in your driver documentation which method you should use to retrieve an nVarchar data type.
Actually, I just doubled checked and the datatype is ntext. I have changed it to varchar to allow for 8000 character storage. This works. I also found that there is a bug in the JDBC ODBC driver involving ntext datatypes.
After searching a lot on the NET....
I realised there is no work around for this issue other than to change the datatype of the column from nvarchar to varchar.
I contacted my dba and asked her to change the nvarchar datatypes columns to varchar. She wasnt ready for that because it was a production database.
So I used a CAST function to convert the nvarchar type to varchar types
for example :
select CAST( columnName as varchar(300)) as columnName from tableName
this worked for me...
hope this helps