What Can We Do with the Slow JDBC?

A Java program connects databases and retrieves data through JDBC. The SQL query is simple, database load is light, and data size is over one hundred thousand rows. Yet the execution is slow. A dozen of seconds are needed. Is there any way to make it faster?

The fact is that JDBC performance is never high. Tests show that Oracle JDBC is several times slower for data retrieval than for text reading. As a built-in component provided by database vendors, there is nothing for our “outsiders” to do to enhance performance.

When the database load is light, we can increase speed using multi-CPU parallel retrieval. It’s easy for esProc SPL to implement the strategy, as shown below:




fork to(4)






The four threads connect to the database respectively via JDBC and concatenate their retrieved data. The execution will be about 4 times faster with a light load database.


esProc SPL also provides JDBC for being called by Java. We save the above script as a script, say load.dfx, and call it from Java as we call a stored procedure:

con = DriverManager.getConnection("jdbc:esproc:local://");
st = con.prepareCall("call load()");
ResultSet rs = st.getResultSet();

Now enjoy the high-speed parallel processing.

SPL Official Website 👉 http://www.scudata.com

SPL Feedback and Help 👉 https://www.reddit.com/r/esProc

SPL Learning Material 👉 http://c.raqsoft.com

SPL Source Code and Package 👉 https://github.com/SPLWare/esProc