Vivek Moyal wrote:You are saying that my Swing code is ok and in different thread of JDBC everyone is said that the code is ok so please tell me where is the problem than
That was me. Michael did a better job in finding the issues.
Joined: Jun 13, 2009
Well, the above looks like your code to create the TableModel. A I see it you are only adding a single "record" to the model and the value of "record" is the last row you read from the ResultSet.
To create a DefaultTableModel you need a Vector of Vectors. So you create a Vector as your main Vector. Then for every row in the ResultSet you create a new Vector and add the data from each column to it. So basically your code is correct expect instead of using an ArrayList of String you should be using a Vector of Vectors and then you can use that Vector directly to create the model.