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?
 
CEHJCommented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.