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.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

CEHJConnect With a Mentor Commented:
You just set it directly

Open in new window

You can make the query using a SwingWorker (see excellent docs) and then set a new DefaultTableModel
namsu55Author Commented:
But would I be able to use foreign keys. Two joined tables in one table model through netbeans.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

namsu55Author Commented:
How do I manipulate the Table Model in Netbeans for a JTable.
namsu55Author Commented:
Thanks CEHJ just having a go at it.
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.