0

I am trying to extract data from a mysql database table and display it on a jtable.

I already created the table in which I would like to display the data and the connection to the database. I found different answers for this question but every single one of them implied the creation of a new table(which would be hard for me because my table is alreary located in a frame and a panel).

enter image description here

I don't want to display all the information from the table so I'd like to use a sql statement (e.g. "select * from bilete where nrbilet=100;").

How could I do it?

  • Please show your code and how far your works, so we could help you. – Sukma Wardana Jan 05 '18 at 01:56
  • *"implied the creation of a new table"* - Well, actually a better solution would be to create a new `TableModel` and apply it to the existing `JTable` – MadProgrammer Jan 05 '18 at 02:21
  • [Conceptually something like this](https://stackoverflow.com/questions/15124904/populating-jtable-using-database-data/15125161#15125161) - although some what more complex then you might need [or more simply like this](https://stackoverflow.com/questions/27815400/retrieving-data-from-jdbc-database-into-jtable/27817394#27817394) – MadProgrammer Jan 05 '18 at 02:23

0 Answers0