I am not sure that I understand the problem. You do not need an Array to populate a table from a database data source, all you need is a repeat region.
Here I have used Session Storage to populate the Array wCart Tutorial part 5. Add Session and Arrays to the Template. This should be similar when using a database data source.