要想 打开MySQL的预处理、缓存、批处理功能,就需要在数据库的连接地址url中将参数设为true:
String url = "jdbc:mysql://localhost:3306/db1?userServerPrepStmts=true&cachePrepStmts=true&rewriteBatchedStatements=true";
userServerPrepStmts:是否打开预处理
cachePrepStmts:是否打开缓存
rewriteBatchedStatements:是否打开批处理
如果想要查看MySQL执行的过程,需要去查看MySQL的日志