dano4734
Posts: 7
|
Posted: 01/09/2008, 6:47 AM |
|
Help
what am I doing wrong. I have a textarea for display only
and just want to load a list of names into it from a table in my sql
my code doesn't work, tried all kinds of stuff. Here is my before show event
I need it urgently thanks in advance
JDBCConnection conn = JDBCConnectionFactory.getJDBCConnection("InternetDB");
String mystest = Utils.convertToString(conn.getRows("SELECT typename FROM hntype"));
e.getControl().setValue(mystest);
conn.closeConnection();
|
|
|
matheus
Posts: 386
|
Posted: 01/09/2008, 10:57 AM |
|
Use Dlookup.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
matheus
Posts: 386
|
Posted: 01/09/2008, 10:58 AM |
|
If was more than one row, then you need iterate over DbRow resulting from conn.getRows.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
dano4734
Posts: 7
|
Posted: 01/09/2008, 11:17 AM |
|
Thanks for the suggestions, do you happen to have a small sample I could look at. it has more than one row in the table, actually about 100 rows and I am a bit of a newbee
|
|
|
dano4734
Posts: 7
|
Posted: 01/10/2008, 10:40 AM |
|
For the next Person with the same need here it is
many thanks to Helen
String mystest = "";
Enumeration records = conn.getRows("your SELECT query");
if (records.hasMoreElements()) {
DbRow record = null;
while (records.hasMoreElements()) {
record = (DbRow) records.nextElement();
mystest = mystest + " " + record.get("field_name");
}
}
|
|
|