• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Printing out ResultSet data

 
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.
 
Bartender
Posts: 9615
16
Mac OS X Linux 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.
 
Oh. Hi guys! Look at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic