public void createOverride ( int groupId , String methodName , String className ) throws Exception { // first make sure this doesn't already exist for ( Method method : EditService . getInstance ( ) . getMethodsFromGroupId ( groupId , null ) ) { if ( method . getMethodName ( ) . equals ( methodName ) && method . getClassName ( ) . equals ( className ) ) { // don't add if it already exists in the group return ; } } try ( Connection sqlConnection = sqlService . getConnection ( ) ) { PreparedStatement statement = sqlConnection . prepareStatement ( "INSERT INTO " + Constants . DB_TABLE_OVERRIDE + "(" + Constants . OVERRIDE_METHOD_NAME + "," + Constants . OVERRIDE_CLASS_NAME + "," + Constants . OVERRIDE_GROUP_ID + ")" + " VALUES (?, ?, ?)" ) ; statement . setString ( 1 , methodName ) ; statement . setString ( 2 , className ) ; statement . setInt ( 3 , groupId ) ; statement . executeUpdate ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } }
given the groupId and 2 string arrays adds the name - responses pair to the table_override