I have a simple JDBC class that happens to query a rather large table (~ 1 million rows) and has a considerable number of columns (~ 300+).
I'm trying to see if it is possible to improve the performance of this code, by either:
Pooling the connection somehow so we can have like 10 or so queries running against the same table?
Removing the looping necessary to get all the columns from the ResultSet object; I noticed a considerable improvement in runtime when I manually unrolled this (over 50% improvement)
I'm hoping there's a dynamic way to find the number of columns once, and use something like:
rs.getColumn(1) + "|" + rs.getColumn(2) + "|" + ... + rs.getColumn(x)
The most "straightforward and simple" way I can think of doing its is having a Python script generate and execute a dynamically generated Java file. Now, that doesn't sound very straightforward to me... so I'm hoping there's something new for me to learn in Java.
Appreciate any help on this!