Severity | 1 |
---|---|
Enabled | yes |
Waivable | |
Violation |
Connection lcon_dbConnection = getConnection(); ResultSet rs = null; int i = 0; while ( i< 10 ){ Statement lst_stmt = lcon_dbConnection.createStatement(); lst_stmt.executeUpdate(sqlString); i++; }; for (int j=0; j<10; j++){ Statement sss_stmt = lcon_dbConnection.createStatement(); lst_stmt.executeUpdate(sqlString); } do{ Statement sss_stmt = lcon_dbConnection.createStatement(); lst_stmt.executeUpdate(sqlString); }while (10< i); |
Fix |
Connection lcon_dbConnection = getConnection(); Statement lst_stmt = lcon_dbConnection.createStatement(); ResultSet rs = null; int i = 0; while ( i< 10 ){ lst_stmt.executeUpdate(sqlString); i++; }; for (int j=0; j<10; j++){ lst_stmt.executeUpdate(sqlString); } do{ lst_stmt.executeUpdate(sqlString); }while (10< i); |