前提・実現したいこと
Springを使用し、テーブルに入っているデータを取得するロジックを作成したいです。
発生している問題・エラーメッセージ
SQLSyntaxErrorException: Table 'xxxx' doesn't exist
が出てしまい、エラーとなってしまう。
該当のソースコード
application.yml
yaml
1spring: 2 datasource: 3 url: jdbc:mysql:replication://localhost:13306/test 4 username: xxxx 5 password: xxxx 6 initialization-mode: always # control the sql db initialization (from schema.sql and/or data.sql)
data.sql
SQL
1create table if not exists xxxx ( 2 id bigint primary key auto_increment, 3 name varchar(45), 4 delete_flag tinyint, 5 updated_dt datetime, 6 created_dt datetime 7);
補足情報(FW/ツールのバージョンなど)
Java8
回答2件
あなたの回答
tips
プレビュー