So i would recommend to see this: Database Programming with JDBC and Java: Chapter 4. Database Access Through JDBC
Type: Posts; User: Mr.777
So i would recommend to see this: Database Programming with JDBC and Java: Chapter 4. Database Access Through JDBC
Okay so take it step by step.
1. You get resultset.
2. Iterate through the result Set
3. Against each iteration, set the value of table column headers.
Isn't it simple?
Okay so you mean that in database data is like
name
1
2
3
and you want to display it in your application like
Well, if you want to set the columnHeaders, use the DefaultTableModel and then using it set the values for table headers. Moreover, What are you talkinga bout printing like box layout and what?...
What is the error? Kindly copy the exception trace and paste here. Well, for your information, rs.getString() never works as you did here;
for (int j1 = 0; j1 < 6; j1++) {
...