java - How to ignore error in JDBC's executeBatch function -
i want insert data rdbms(mysql5.7, jdbc5.1), , using executebatch speed up. found when 1 insert sql of batch of statement cannot execute properly, remain ignored. have not expectd. want let rdbms ignore error sql , continue execution.
can tell me should or show me right documentation url. , glad help!
and know "insert ... on duplicate key ... " can ignore duplicate key error , want 1 more general solution.
connection connection = getconn(); statement statemenet = connection.createstatement(); (searchuseritem user: result.getitems()) { string query = "insert table values(some_values)"; } int[] re = statemenet.executebatch(); ananlysebatchresult(re); statemenet.close(); connection.close();
Comments
Post a Comment