但语句对象提交不同的sql语句进行批处理,而预置语句提交的是一组参数。
But a statement object submits different SQL statements to batch, while prepared statement submits a set of parameters to batch.
首先,应当关闭自动提交模式,这样,每条sql语句的结果不会被自动提交给数据库。
First, you should turn off autocommit mode so the results of each SQL statement aren't automatically committed to the database.
当您提交该语句时,您必须添加RETURN_GENERATED _ KEYS选项,这将返回自动生成的值。
When you submit the statement, you must add the RETURN_GENERATED_KEYS option, which returns the automatically generated value.
应用推荐