What is the advantage of preparedstatement over statement?



What is the advantage of preparedstatement over statement?..

Answer / Mahesh Chauhan

A PreparedStatement in Java offers several advantages compared to a Statement. It provides pre-compiled SQL statements, which makes it more efficient when executing the same query multiple times. Additionally, it allows for parameterized queries, reducing the risk of SQL injection attacks and improving performance by reusing the compiled statement.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?

1 Answers   Global Logic,


Which is bigger float or double?

1 Answers  


What is a cup of java?

1 Answers  


What are different types of expressions?

1 Answers  


What methods are used to get and set the text label displayed by a button object?

1 Answers  


Is there any use of an abstract class which has no methods and no attributes?

1 Answers   Wipro,


When should the method invokelater() be used?

1 Answers  


What is collections framework?

1 Answers  


What does java stand for?

1 Answers  


What defines function?

1 Answers  


There are three interfaces A,B & C. A extends B, B extends C, and C extends A.Is it multiple Inheritance? please anybody help me.....

5 Answers  


String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects

7 Answers  


Categories