2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MyBatisでのMySQLストアドの呼び出し

Posted at

MyBatisからMySQLのストアドを呼ぶ場合の書式

mybatis_stored_sample.xml
<select id="ID名" parameterType="パラメータの型" resultType(or resultMap)="戻りの受けの型" statementType="CALLABLE">
{call ストアド名(#{パラメータ型の名称, mode=IN, jdbcType=JDBCの対応する型},#{出力パラメータの型, mode=OUT, jdbcType=対応するJDBCの型})}
</select>

って感じで呼び出せる。
但し、ストアドからの戻りリターンが複数個所記述があると、resultがおかしくなるので1か所にする事。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?