Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Java SP and LONG data question
I'm working on a Java Stored Procedure that needs to query data which includes a LONG column. I am trying to write the results of the query to a CSV file and need to remove any carriage returns or line feeds or commas from the LONG data before I write it out to my file. So far this works nicely except when the LONG column is null. Using the java.sql.ResultSet.wasNull() method works properly for all columns except the LONG column. In that case, wasNull() returns true even if the column was indeed null.
Is there an alternative means of determining if the LONG column was in fact null?
An example of my code:
ResultSet rs = stmt.ExecuteQuery("select alongcolumn from mytable");
String tmp = rs.getString(1);
if (!rs.wasNull()) {
tmp = tmp.replace('\n', ' ');
tmp = tmp.replace(',', ' ');
}
Thanks in advance.
-- Ken Rachynski Programmer EVANS http://evansonline.com/Received on Thu Dec 07 2000 - 15:27:15 CST