I have a memo field in a Access database that I want to query and return to a string.
I can't figure out how to do so.
Any thoughts?
Steve
Printable View
I have a memo field in a Access database that I want to query and return to a string.
I can't figure out how to do so.
Any thoughts?
Steve
Erm, you might have already tried this , but in case you haven't:
apart from wrapping it in a try catch block that should work, the memo field in Access should have the ability to be pulled out as a String...Code:
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("Select memocolumn from table");
while(rs.next()){
String str = rs.getString(1);
System.out.println(str);
}
rs.close();
stmt.close();
failing that, and i can't be certain, you might be able to use the rs.getClob(1) method, and this should return the data type of character large object...
try and stick with the getString if you can, its a lot easier! ;)
Andy
i tried that and it didn't seem to work..i'll give it another go round
steve
have you tried the Object obj = rs.getObject(columnName)
and then probed the obj to find out what it thinks it is?