title: Simple query takes too long via JDBC but very quick from MySQL console
body: <p>I have a simple query and it takes only 0.2 seconds when I execute it on mysql console. But when I execute this query via jdbc from my runnable java jar, it takes about 15 seconds to get the data (20000 rows).</p>
  
  <p>This query is so simple and the field in my WHERE clause is indexed and I am selecting two columns only.</p>
  
  <p>I tried both BoneCP connection pool and simple jdbc connection. But in both cases the result is almost the same. It looks there is something taking too much time while getting data from mysql to java side but I can not imagine how. So I can not come up with a solution.</p>
  
  <p>Query example:</p>
  
  <pre><code>SELECT eventType, eventId  FROM users WHERE uid=55;
  </code></pre>
  
  <p>uid is indexed. It takes 0.2 second from mysql console but 15 seconds via my jar. By the way 15 second is really the time that takes while executeQuery() is being executed. </p>
  
  <p>note: Before I am posting that question I searched in here, but could not find a real answer.</p>
  
  <p><strong>Solved. See my comment below</strong></p>