Statement对象: 用于执行不带参数的简单SQL语句: 特点: a. 只执行单条的sql语句: b. 只能执行不带参数的sql语句: c.运行原理的角度,数据库接收到sql语句后需要对该条sql语句进行编译后才执行: d.与其它接口对比,适合执行单条且不带参数的sql语句,这种情况执行效率相对较高. PreparedStatement对象 执行带或不带 IN 参数的预编译 SQL 语句: 特点: a. 继承自Statement接口(意味着功能相对更加全面): b. 带有预编译的特性: c.
1.Statement.PreparedStatement和CallableStatement都是接口(interface). 2.Statement继承自Wrapper.PreparedStatement继承自Statement.CallableStatement继承自PreparedStatement. 3. Statement接口提供了执行语句和获取结果的基本方法: PreparedStatement接口添加了处理 IN 参数的方法: CallableStatement接口添加了处理 OU
原文 An object that represents a precompiled SQL statement. A SQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. Note: The setter methods (setShort,