Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to display an SQL query into a JTable in Netbeans

Posted on 2009-04-04
6
Medium Priority
?
859 Views
Last Modified: 2013-12-29
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.
0
Comment
Question by:namsu55
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24085722
You can make the query using a SwingWorker (see excellent docs) and then set a new DefaultTableModel
0
 

Author Comment

by:namsu55
ID: 24086017
But would I be able to use foreign keys. Two joined tables in one table model through netbeans.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24086111
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:namsu55
ID: 24086624
How do I manipulate the Table Model in Netbeans for a JTable.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 24090444
You just set it directly
table1.setModel(model);

Open in new window

0
 

Author Comment

by:namsu55
ID: 24091280
Thanks CEHJ just having a go at it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question