a table "pinfo" like this:
name age remark
---------------------------
Jim.K 33 NULL
Harod.B 44 book publisher
Keny 22 NULL
now i want to do a query "select * from pinfo",and put result into a
jtextarea.
when using ResultSet to get records, it seems that i can only get
"Jim.K 33" and stopped reading at remark.
so how to get All records in this situation ?
Belmont.O@gmail.com - 23 Jan 2005 05:17 GMT
anyone help ?
Lee Fesperman - 23 Jan 2005 08:37 GMT
> anyone help ?
Ok, but you need to provide more information. Your terminology is imprecise -- you talk
about reading records and then refer to columns.
Please carefully describe the effects you are seeing. If you're receiving an exception,
provide all the information from the exception. And, it would be best if you posted some
code to help with your description.

Signature
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
psl.stanford.edu - 24 Jan 2005 05:41 GMT
> a table "pinfo" like this:
> name age remark
[quoted text clipped - 8 lines]
> "Jim.K 33" and stopped reading at remark.
> so how to get All records in this situation ?
try providing more information:
1). what do u get with the statement when you use SQL*PLUS?
2). The actual code you used to retrieve records.
Jim
CD1 - 25 Jan 2005 11:33 GMT
Hi Belmon!
You can do something like this:
Statement statement = connection.createStatement();
String query = "select * from pinfo"; // your query
ResultSet rs = statement.executeQuery(query);
while (rs.next()) {
your_textarea.append(rs.getString("name") + " ");
your_textarea.append(rs.getString("age") + " ");
your_textarea.append(rs.getString("remark") == null ? "" :
rs.getString("remark") + "\n");
}
Anyway, you format it the way you want. But I think that null verifying
is useful for you. You have to put it on the fields which MAY be null,
that's why I didn't put it to name or age.. because, by your example,
name or age can't be NULL.
See ya,
Cristian Deives