Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing out ResultSet data  RSS feed

 
Thabo Matjuda
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys . I have created a multi client-server application. The client has a Search button which when pressed, it must tell the server to search for whatever the user has typed in a text field. The server searches from an SQL 2000 Database. Now there is a section that I am stuck at. When the server has the data...
In other words, like the following piece of code:

//Loops through all the rows returned from the query and
//writes them to the client
while (res.next()) {
int movieID = res.getInt(1);
String movieName = res.getString(2);
String movieDesc = res.getString(3);
String genre = res.getString(4);
pw.println(movieID);
pw.println(movieName);
pw.println(movieDesc);
pw.println(genre);
}

I want need help on how to print these rows to client and then putting them in a J Table with 4 Columns.
The J Table is in the client, which is why I must print them out first then client must take data and put in J Table.
I hope I am clear on my request. Thanks in advance.
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Tutorial has a page on JTable. Have a look at it and you'll probably see what you need to do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!