1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【MyBatis】jdbcTypeを勘違いしていた

Posted at

結論

jdbcTypeは、java↔︎DB間でのマッピングで扱う型の指定。
jdbcType = DBの型、では無い。

経緯

DB仕様にて型を確認した際、対象のカラムがTEXT型だったため、
何の気なしに「#{param, jdbcType=TEXT}」と記入。

springを起動してみるとエラー。

エラー文には「jdbcType: TEXTは存在しません」(※意訳)と表示される。

今回の事象は「#{param, jdbcType=VARCHAR}」もしくは「#{param}」(jdbcType省略)とすることで解消できました。

参考

◾️MyBatis公式ドキュメント > サポートされている JDBC データ型

◾️postgres データ型一覧

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?