• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to display all the results of a Table?

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello;
I have a problem displaying all the results of a Table from my database. My purpose is to display all the results of the table to My given JTextFields.
for example :
Statement statement1 = connect.createStatement();
String query1 = "SELECT FROM Lastname";

ResultSet rs1 = statement1.executeQuery(query1);
rs1.next();
// here's the problem. I don't know how to get all the results
// what I know is to display only the 1st string.
// is there any method to display all the results of a table.
// instead of displaying only the 1st String?
String pass1 = "" + rs1.getString(1);
x's: Pls. help its an emergency !.
Thanks . . .
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(I'm perhaps not completely understanding your question.)
If I've a table called student that has fields fName and lName, and I want to display the name of everybody in the table, then I might use code similar to the following.Getting any ideas?
[ March 16, 2003: Message edited by: Dirk Schreckmann ]
reply
    Bookmark Topic Watch Topic
  • New Topic