One of the statementtype:statement,prepared or callable. This allows MyBatis to use statement,preparedstatement or CallableStatement, respectively, with the default value: PREPARED.
<?XML version= "1.0" encoding= "UTF-8"?><!DOCTYPE Mapper Public "-//mybatis.org//dtd mapper 3.0//en" "Http://mybatis.org/dtd/mybatis-3-mapper.dtd "><Mappernamespace= "Com.fujitsu.tti.biz.f64.dao.itpdb.F64GoodsInfoSelectDao"> <SelectID= "Goodsinfoselect"ParameterType= "Integer"StatementType= "callable"Resulttype= "Com.fujitsu.tti.biz.f64.model.GoodsInfo">{call F64_goodsinfo_select (#{eigyousyoid, jdbctype = INTEGER, mode = in})}</Select> </Mapper>
1.Statement, PreparedStatement, and CallableStatement are all interfaces (interface).
2.Statement inherits from Wrapper, PreparedStatement inherits from statement, CallableStatement inherits from PreparedStatement.
3. The statement interface provides a basic method for executing statements and obtaining results;
The PreparedStatement interface adds a method for handling in parameters;
The CallableStatement interface adds methods for handling out parameters.
4.
Statement:
PreparedStatement:
CallableStatement:
Inherit from PreparedStatement, support SQL operation with parameters; Support for calling stored procedures, providing support for output and input/output parameters (INOUT);
Mybatis--mapper XML file (statementtype)