I am trying to read in values from the SQLite database and I have the following question: What data structure would you use if the API only allows you to proceed row by row without the possibility of checking how many rows there are? I would like to stress the fact that I want to return a two dimensional array at the end… Would you you list of lists and then convert?
Share
i think its better to return list of object you trying to get its data, for example if you want to get all students form database, you could make class for that:
then you can retrieve all student in list
Edit:
to get the size of result set, you can call resultset.last() then call resultset.getRow(), it was discussed here:
How do I get the size of a java.sql.ResultSet?
How to get a number of rows a ResultSet contains?
then you can build your 2D array: