2

i have created a model class to connect with database with a function that retrives a table data.now this function should return whole resultset back to a Controller action page. further controller action should send the data to jsp page for client viewing.

or simply how to hold Resultset data from query like..select * from table

1

1 Answer 1

1

In Model class you can convert your ResultSet into List which subsequently returned to view.The only code you need to write is converting ResultSet into List of Object

Sign up to request clarification or add additional context in comments.

2 Comments

i used ArrayList.i got class cast exception:ResultSet cannot be cast to ArrayList
Yeah ResultSet can't be converted into ArrayList. You need to iterate over ResultSet and insert each object from ResultSet into ArrayList

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.