Mr. Boy Mr. Boy - 1 year ago 94
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.