1
1

More than 3 years have passed since last update.

【Spring】データベースから取得できない

Posted at

環境

Windows10
SpringBoot(v2.4.0)
pleiades 2020
MySQL 8.0

エラー

com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string [データベースのデータ]

原因(型の不一致)

Entityクラスの型が間違っていました。

  • データベースはVARCHAR
  • EntityクラスでInteger

にしていました。

解決法(Entityクラスの型をStringにする)

private Integer [カラム名]
変更
private String [カラム名]

ただこれだけ。

初心者にありがちなミス。エラーをそのままググっても英語ばかりでなかなか見つかりません。

とりあえず
Cannot determine value type
とあるように、value type = データ型
としっかり見定めてからググるべきでした。

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