@@ -77,11 +77,8 @@ public void executeScript(String scriptFilePath) throws SQLException {
7777 if (line .endsWith (";" )) { // Execute statement when semicolon is found
7878 String sql = sqlBuffer .toString ().trim ();
7979 try {
80- int rowsUpdated = statement .executeUpdate (sql );
81- LOGGER .debug ("Query {} executed {} rows affected" , sql , rowsUpdated );
80+ statement .executeUpdate (sql );
8281 } catch (SQLException e ) {
83- LOGGER .error ("Error executing query {}" , sql , e );
84- // re:throw this as unhandled exception
8582 throw new RuntimeException (e );
8683 }
8784 sqlBuffer .setLength (0 ); // Clear the buffer for the next statement
@@ -92,11 +89,7 @@ public void executeScript(String scriptFilePath) throws SQLException {
9289 connection .setAutoCommit (autoCommit );
9390 }
9491 } catch (IOException e ) {
95- LOGGER .debug ("Error reading the script file" , e );
9692 throw new RuntimeException (e );
97- } catch (SQLException e ) {
98- LOGGER .debug ("Error executing the script file" , e );
99- throw e ;
10093 }
10194 }
10295
@@ -135,7 +128,6 @@ public <T, R> List<R> executeSelect(
135128 }
136129 return resultList ;
137130 } catch (SQLException e ) {
138- LOGGER .debug ("Error executing query {}" , query , e );
139131 throw e ;
140132 } catch (Exception e ) {
141133 throw new RuntimeException (e );
@@ -156,9 +148,6 @@ public int executeUpdate(String query) throws SQLException {
156148 connection .setAutoCommit (true );
157149 try {
158150 return statement .executeUpdate (query );
159- } catch (SQLException e ) {
160- LOGGER .debug ("Error executing query {}" , query , e );
161- throw e ;
162151 } finally {
163152 connection .setAutoCommit (autoCommit );
164153 }
@@ -188,9 +177,6 @@ public void runWithinTransaction(TransactionCallback callback) throws SQLExcepti
188177 }
189178 connection .setAutoCommit (autoCommit );
190179 }
191- } catch (SQLException e ) {
192- LOGGER .debug ("Caught Error while executing transaction" , e );
193- throw e ;
194180 }
195181 }
196182
0 commit comments