Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to call Oracle stored procedure in Mybatis

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Mybatis how to call Oracle stored procedures, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

1: call a stored procedure with no parameters.

Create a stored procedure:

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

Mapper.java

MapperTest.java test

2: stored procedure calls with parameters:

2.1 creation of stored procedures:

Configuration of 2.2Mapper.xml:

2.3Mapper.java

2.4MapperTest.java test

Console output:

3: the result set call of the stored procedure.

3.1 create a stored procedure:

3.2 Mapper.xml configuration

Configure resultMap result set fields

Mybatis is slightly different. At this time, jdbcType is CURSOR,javaType and ResultSet. Here, you can convert the result to resultMap, as shown below.

3.3 Mapper.java

3.4 MapperTest.java test

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report