Results 1 to 3 of 3
Thread: Resultset to array
- 02-24-2012, 09:40 AM #1
Member
- Join Date
- Feb 2012
- Location
- Philippines
- Posts
- 1
- Rep Power
- 0
Resultset to array
hello fellaz, the thing that killing me was very simple i think...
what i need to do right now is to get the data from mysql table and then stored it into array..
so that i can dispaly it in Jtable... just like this
String colums[] = {"First Name", "Last Name"};
Object rows[][];
int ctr = 0;
while(rs.next()){
rows[ctr][0] = rs.getString("fname");
rows[ctr][0] = rs.getString("lname");
ctr++;
}
userTable = new JTable(rows, columns);
but it doesn't work...
please help
thanks
marjune
- 02-24-2012, 10:27 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
Re: Resultset to array
"it doesn't work" tells us almost nothing of any use.
What doesn't work?
Errors?
Exceptions?
Stack traces?
Information!Please do not ask for code as refusal often offends.
- 02-24-2012, 01:18 PM #3
Similar Threads
-
Strange behaviour of If statement inside an Array derived from ResultSet
By matthelazy in forum New To JavaReplies: 3Last Post: 08-08-2011, 05:07 PM -
ResultSet to array
By Jojomofoman in forum New To JavaReplies: 2Last Post: 01-08-2011, 09:10 PM -
Help with Resultset
By xxAlemanxx in forum JDBCReplies: 6Last Post: 06-24-2008, 11:09 AM -
ResultSet to XML
By Java Tip in forum Java TipReplies: 0Last Post: 02-14-2008, 09:50 AM -
ResultSet example
By Java Tip in forum Java TipReplies: 0Last Post: 01-20-2008, 08:59 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks