wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Pasting Data Base results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Pasting Data Base results " Watch "Pasting Data Base results " New topic

Pasting Data Base results

Luis Canizares

Joined: Mar 12, 2005
Posts: 12
Does anyone know how to show a complete result grid into any object of Swing or AWt directly like in Visual Basic (I dont like it so much)?
Please let me know your answers

Good luck folks !!
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

You mean like a JTable? You may also want to look at JDNC which includes data bindings for a JTable to (arguably) make things easier. If you are unfamiliar with JTables I would recommend holding off on JDNC and getting the basics down first though.

GenRocket - Experts at Building Test Data
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
I use the JTable constructor which accepts two Vectors (one for the rows of data, one for the column names...take a look at the API as suggested above. You can populate these Vectros easily from the ResultSet object of a JDBC query.

SCJP 1.4, www.gsi3d.org.uk
jQuery in Action, 2nd edition
subject: Pasting Data Base results