随笔都是学习笔记
随笔仅供参考,为避免笔记中可能出现的错误误导他人,请勿转载。

 要想 打开MySQL的预处理、缓存、批处理功能,就需要在数据库的连接地址url中将参数设为true:

String url = "jdbc:mysql://localhost:3306/db1?userServerPrepStmts=true&cachePrepStmts=true&rewriteBatchedStatements=true";

 

userServerPrepStmts:是否打开预处理

cachePrepStmts:是否打开缓存

rewriteBatchedStatements:是否打开批处理
如果想要查看MySQL执行的过程,需要去查看MySQL的日志

posted on 2022-05-04 11:31  时间完全不够用啊  阅读(332)  评论(0编辑  收藏  举报