0

sample table

I want to bind some table tuples in mysql database to above table shown image. I use netbean to design this GUI and table property have some features to bind data to this table. but I want to manually code it. as an example in below sqlQuery return data, how to bind to jtable using manual code ?

 String sqlQuery ="SELECT packet_id, packet_capacity FROM packing LIMIT 0,20 DESC"

1 Answer 1

1

Use the link to understand how to retrieve data from your DB and create a TableModel. The just call yourTable.setModel(theModelFromResultSet);

You can use Db query based sort. Just pass the sort column as ORDER BY part of the query.

Or you can use the answer Display resultset in custom jtable

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.