Link to home
Start Free TrialLog in
Avatar of namsu55
namsu55Flag for United Kingdom of Great Britain and Northern Ireland

asked on

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.
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You can make the query using a SwingWorker (see excellent docs) and then set a new DefaultTableModel
Avatar of namsu55

ASKER

But would I be able to use foreign keys. Two joined tables in one table model through netbeans.
Avatar of namsu55

ASKER

How do I manipulate the Table Model in Netbeans for a JTable.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of namsu55

ASKER

Thanks CEHJ just having a go at it.