[NETBEANS] How to display query result in a grid

M

Mariano

I've a data source, i've to make a query on this data source, how can
I show all result in a grid (JTable)? I'm using Netbeans 5.5. If
someone of u can suggest me a good guide on the topic.... a lot of
thanks
 
D

Dimitri Kurashvili

I've a data source, i've to make a query on this data source, how can
I show all result in a grid (JTable)? I'm using Netbeans 5.5. If
someone of u can suggest me a good guide on the topic.... a lot of
thanks

It is not so straitforward. You can not simply put ResultSet on
JTable. The best way is to use TableModel interface (you should
implement it using data obtained from database).

Where to read about this?
Try this:

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
 
J

josh

Mariano napisał(a):
I've a data source, i've to make a query on this data source, how can
I show all result in a grid (JTable)? I'm using Netbeans 5.5. If
someone of u can suggest me a good guide on the topic.... a lot of
thanks

Take a look at SwingSet project:
http://swingset.sourceforge.net/

They should have everything you need to create an application with
database back-end.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top