I'm a .net developer that would like to try develop some simple apps in Java. I would like to know how to do databinding in Java.
How can I show a query result in a JTable?
I'm a .net developer that would like to try develop some simple apps in Java. I would like to know how to do databinding in Java.
How can I show a query result in a JTable?
GustlyWind's comment is the best place to look on how to use a JTable. The key for the data is getting the items in a model. You can use the DefaultTableModel which would require that your table results are put into a 2D Array or Vector. Or you could implement your own model that uses other custom objects from your application or a different underlying data structure.
Either way, as you loop through the ResultSet of your query you are going to have to pull the relevant data and stick it in some sort of Collection.