8 283
How to use PreparedStatement in Java - JDBC Example Tutorial
PreparedStatement is used to execute specific queries that are supposed to run repeatedly, for example, SELECT * from Employees WHERE EMP_ID=?. This query can be run multiple times to fetch details of different employees. If you use PreparedStatement like above then the database assists in query preparation, which is faster and more secure. Such kinds of queries are compiled, and their query plans are cached at the database side every time you execute it, you will get a faster response as opposed to using simple queries via Statement object, like SELECT * from Employees WHERE EMP_ID + emp_id.
Java Interview questions and tutorials
Read: http://www.java67.com/2019/08/how-to-use-preparedstatement-in-jdbc-java.html
19 يوليو 2022, 09:19
