天天看點

jdbc的prepareStatement和Statement比較

利用Connection調用Statement對象Executor操作,每次在和資料庫互動的時候,都會涉及到資料庫的重新編譯,相對于prepareStatement對象執行Executor操作,相同的查詢模闆,在之後的查詢過程中可能不會涉及資料庫對查詢語句的重新編譯,隻需要涉及到sql語句中的參數。

jdbc的prepareStatement和Statement比較