Home > Java > javaTutorial > Mybatis calls Oracle stored procedure method explained

Mybatis calls Oracle stored procedure method explained

巴扎黑
Release: 2017-09-05 14:43:25
Original
3562 people have browsed it

This article mainly introduces the method of Mybatis calling Oracle stored procedures. Friends in need can refer to

1: Calling stored procedures without parameters.

Create stored procedure:

Mapper.xml configuration: After testing, other tags (update, insert, select) are also available.

Mapper.java

MapperTest.java test

2: Stored procedure call with parameters:

2.1 Creation of stored procedure:

2.2 Configuration of Mapper.xml :

2.3Mapper.java

##2.4MapperTest.java Test

Console output:

3: Result set call of stored procedure.

3.1 Create stored procedure:

3.2 Mapper.xml configuration

Configuration The resultMap result set field

is slightly different in mybatis. At this time, jdbcType is CURSOR and javaType is ResultSet. You can also convert the result into resultMap here, as shown below

3.3 Mapper.java

3.4 MapperTest.java test


The above is the detailed content of Mybatis calls Oracle stored procedure method explained. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template