insert data to mysql slow
===

table
<pre>
+-----------+--------------+------+-----+-------------------+----------------+
| Field     | Type         | Null | Key | Default           | Extra          |
+-----------+--------------+------+-----+-------------------+----------------+
| id        | int(11)      | NO   | PRI | NULL              | auto_increment |
| name      | varchar(32)  | NO   |     | NULL              |                |
| pid       | varchar(32)  | NO   |     | NULL              |                |
+-----------+--------------+------+-----+-------------------+----------------+
</pre>
procedure:test

    begin
      set @i=0;
      while @i<200 do
        insert into test.table_test
          (name, pid) values ('1', '1');
        set @i=@i+1;
      end while;
    end
run:

    mysql> call test();
    Query OK, 0 rows affected (17.24 sec)

but when i insert data with jdbc, it only cast about 0.9 sec to insert 10^6 rows (if i use batch insert, it only cast about 0.24 sec to insert 10^6 rows).

why it is much slow to insert data with query, but quick with jdbc?