String sql = “insert into username.tablename(id) values(?)”; PreparedStatement stmt = conn.prepareStatement(sql); int rownum = 0; while (rownum < 99999) { stmt.setString(1, UUID.randomUUID().toString()); stmt.addBatch(); rownum ++; } stmt.executeBatch(); conn.commit();