Statement
Use to share your database. Useful when you use static SQL statements at runtime. The Statement interface cannot accept parameters.
The use of Statement in JDBC must be 100% localized for use in DDL (ALTER, CREATE, GRANT, etc.), since they are the only types of statements that cannot accept BIND VARIABLES.
PreparedStatement
Use when you plan to reuse SQL queries. The PreparedStatement interface accepts input parameters at run time.
PreparedStatements or CallableStatements should be used for EACH OTHER statement type (DML, Requests). Because these are types of operators that accept bind variables.
source share