Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC MySQL Driver - Too slow

843859Jul 10 2010 — edited Nov 20 2014
Greetings,
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2010
Added on Jul 10 2010
29 comments
1,444 views