天天看点

jdbc的prepareStatement和Statement比较

利用Connection调用Statement对象Executor操作,每次在和数据库交互的时候,都会涉及到数据库的重新编译,相对于prepareStatement对象执行Executor操作,相同的查询模板,在之后的查询过程中可能不会涉及数据库对查询语句的重新编译,只需要涉及到sql语句中的参数。

jdbc的prepareStatement和Statement比较