|
-
Apr 1st, 2004, 10:50 PM
#1
Thread Starter
Lively Member
SQL: Returning a query into a string
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
-
Apr 12th, 2004, 03:52 PM
#2
Addicted Member
getStrng()
Erm, you might have already tried this , but in case you haven't:
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();
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...
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
-
Apr 12th, 2004, 04:08 PM
#3
Thread Starter
Lively Member
i tried that and it didn't seem to work..i'll give it another go round
steve
-
Apr 12th, 2004, 04:13 PM
#4
Addicted Member
have you tried the Object obj = rs.getObject(columnName)
and then probed the obj to find out what it thinks it is?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|