@@ -162,10 +162,12 @@ public void setCursorName(String name) throws SQLException {
162162 @ Override
163163 public boolean execute (String sql ) throws SQLException {
164164 this .executedSql = sql ;
165+ if (connection .resultSetCache .checkIfExists (ResultSetCache .getKey (executedSql )))
166+ return true ;
165167 if (backendStatement != null )
166168 return backendStatement .execute (sql );
167169 else
168- return connection . resultSetCache . checkExists ( ResultSetCache . getKey ( executedSql ) );
170+ throw new SQLException ( "No cache entry" );
169171 }
170172
171173 @ Override
@@ -306,28 +308,34 @@ public int executeUpdate(String sql, String[] columnNames) throws SQLException {
306308 @ Override
307309 public boolean execute (String sql , int autoGeneratedKeys ) throws SQLException {
308310 executedSql = sql ;
311+ if (connection .resultSetCache .checkIfExists (ResultSetCache .getKey (executedSql )))
312+ return true ;
309313 if (backendStatement != null )
310314 return backendStatement .execute (sql , autoGeneratedKeys );
311315 else
312- return connection . resultSetCache . checkExists ( ResultSetCache . getKey ( executedSql ) );
316+ throw new SQLException ( "No cache entry" );
313317 }
314318
315319 @ Override
316320 public boolean execute (String sql , int [] columnIndexes ) throws SQLException {
317321 executedSql = sql ;
322+ if (connection .resultSetCache .checkIfExists (ResultSetCache .getKey (executedSql )))
323+ return true ;
318324 if (backendStatement != null )
319325 return backendStatement .execute (sql , columnIndexes );
320326 else
321- return connection . resultSetCache . checkExists ( ResultSetCache . getKey ( executedSql ) );
327+ throw new SQLException ( "No cache entry" );
322328 }
323329
324330 @ Override
325331 public boolean execute (String sql , String [] columnNames ) throws SQLException {
326332 executedSql = sql ;
333+ if (connection .resultSetCache .checkIfExists (ResultSetCache .getKey (executedSql )))
334+ return true ;
327335 if (backendStatement != null )
328336 return backendStatement .execute (sql , columnNames );
329337 else
330- return connection . resultSetCache . checkExists ( ResultSetCache . getKey ( executedSql ) );
338+ throw new SQLException ( "No cache entry" );
331339 }
332340
333341 @ Override
0 commit comments