private static void hackFixForProjectMeasureTreeQueries ( Connection connection ) { int metricId = 1 ; try ( PreparedStatement preparedStatement = connection . prepareStatement ( "insert into PROJECT_MEASURES (METRIC_ID,COMPONENT_UUID,ANALYSIS_UUID) values (?,?,?);" ) ) { batchExecute ( 1 , 1000 , preparedStatement , connection , ( stmt , counter ) -> { preparedStatement . setInt ( 1 , metricId ) ; preparedStatement . setString ( 2 , "foo_" + counter ) ; preparedStatement . setString ( 3 , "bar_" + counter ) ; } ) ; } catch ( SQLException e ) { throw new RuntimeException ( "Failed to insert fake rows into table PROJECT_MEASURES" , e ) ; } }
see SONAR - 8586