I've tried a select statement now with a PreparedStatement
, but it turned out that it was not faster than the Jdbc template. Maybe, as mezmo suggested, it automatically creates prepared statements.
Anyway, the reason for my sql SELECT
s being so slow was another one. In the WHERE
clause I always used the operator LIKE
, when all I wanted to do was finding an exact match. As I've found out LIKE
searches for a pattern and therefore is pretty slow.
I'm using the operator =
now and it's much faster.