Mybatis--mapper XML file (statementtype)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.