How to display an SQL query into a JTable in Netbeans

I currently have a TableModel bound to a table in the database, the values and columns output fine. However, is there any possible way to make an sql query rather than display one table. I have made an SQL View from Netbeans under Services/Databases for the database, but can't seem to use it anywhere for the table model.
namsu55Asked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
You just set it directly
table1.setModel(model);

Open in new window

0
 
CEHJCommented:
You can make the query using a SwingWorker (see excellent docs) and then set a new DefaultTableModel
0
 
namsu55Author Commented:
But would I be able to use foreign keys. Two joined tables in one table model through netbeans.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
namsu55Author Commented:
How do I manipulate the Table Model in Netbeans for a JTable.
0
 
namsu55Author Commented:
Thanks CEHJ just having a go at it.
0
All Courses

From novice to tech pro — start learning today.