Mr. Boy Mr. Boy - 2 years ago 104
MySQL Question

Can Java batch calls to SQL stored procedures?

Java: Insert multiple rows into MySQL with PreparedStatement covers batching multiple INSERTs into one operation. I wondered if it is possible to do the same with calls to stored procedures, more specifically with MySQL? If so, what statement class would be used?

Answer Source

You can use executeBatch(). See this example

Note: I haven't validated example by running in my local, but as per documentation it should work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download