JDBC MySQL Driver - Too slow
843859Jul 10 2010 — edited Nov 20 2014Greetings,
I have currently created a simple database having a single table, and I am using JDBC MySQL Connecter J 5.1.5 to retrieve data from it. A single SELECT statement takes about 250 - 320 millsecs to execute and retrieve the data which I believe is too much if you take into account that I am only retrieving 10 tuples. I have also tried the latest MySQL Connecter/J 5.1.13 but I haven't seen any differnce in the performance.
In particular, here is the statement I am running:
ResultSet resultSet = statement.executeQuery("SELECT sensor_id FROM " + tblName +
" WHERE node_id = " + nodeId);
ArrayList<Integer> sensorIds = new ArrayList<Integer>();
while (resultSet.next())
{
sensorIds.add(resultSet.getInt(1));
} // while
Any help is appreciated,
thank you.