I m using following code for retrive record from table .
final List<List> resultTable = new ArrayList<List>();
int maxColumn = resultset.getMetaData().getColumnCount()+1;
while(resultset.next())
{
final List row = new ArrayList();
for(int colIndex = 1; colIndex < maxColumn ; colIndex++){
row.add(resultset.getObject(colIndex));
}
resultTable.add(Collections.unmodifiableList(row));
}
return resultTable
it will retrieve only one row as per my query , but i want to display data as one cloumn .
can any one help me please
Where to write the query and get the result set?
Also, do you have an answer to this question?
If you have only one row you in your resultset you can do this :
final List<List> resultTable = new ArrayList<List>();
int maxColumn = resultset.getMetaData().getColumnCount()+1;
while(resultset.next())
{
for(int colIndex = 1; colIndex < maxColumn ; colIndex++){
final List row = new ArrayList();
row.add(resultset.getObject(colIndex));
resultTable.add(Collections.unmodifiableList(row));
}
}
return resultTable;
Thanks for your ans , can you pl describe how to display .
because . the code which you gave and i store data into javalist
and on form take table and give initial value as that list.
but still it shows one row with all cloumn.
i want to display one cloumn with multiple row.
what i done wrong?
To do that I think you need to keep you first code and before the return you rotate your ArrayList<List>.
I don’t know how to do that. Maybe you can find this on google.
ok thanks .
any one pl can any one help me