CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 trying to load multiple rows into a textarea help

Print topic Send  topic

Author Message
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();
View profile  Send private message
matheus

Posts: 386
Posted: 01/09/2008, 10:57 AM

Use Dlookup.
_________________
Matheus Trevizan

Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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");
}
}
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.