This function returns ArrayList that consists of some data from DB:

public ArrayList<ArrayList<Object>> executeQuery(String host, String database,
            String sqlStatement)

I have to populate JTable with this particular ArrayList. For example, among possible results might be (3 rows, 4 posts):

[[1, 10, 1, 2], [2, 11, 2, 1], [3, 12, 3, 1]]

I understand that the table model ought to be produced, but let's say the posts aren't known prior?

You should use the techniques of [cde] to obtain the number and names of the table's characteristics. You should use Class Literals as Runtime-Type Tokens to populate your computer data structure dynamically. Also consider programming towards the interface, e.g DatabaseMetaData or List<List<Number>>.