LoginSignup
0
0

More than 1 year has passed since last update.

qiitaに上がっていた初心者用webアプリ(java)を作成してみたときの備忘録

Posted at

1.はじめ

Qiitaに投稿されていたwebアプリを作成した際に悩まされたエラーの解消方法について記載しておきます。

2.対象エラー

There was an unexpected error (type=Internal Server Error, status=500).
could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet

SQLに関するエラーだとはわかりましたが、今回SQLファイルは作成していなかったのでどこでエラーになっているのかわかりませんでした。

3.解決方法

上記エラーで検索してヒットしたサイトを見てみると、SQLテーブルを事前準備として作成しているサイトが多く見つかりました。
そこで、テーブルを作成するSQLを対象サーバー内で実行しました。
すると、エラーは消えて動くようになりました。

create table customer (
    id              serial   primary key, name            varchar(20));

てっきりテーブルは自動作成されるものだと思っていたのが原因だったようです。

4.まとめ

ほかにもupdate.htmlのファイルにコードを書き漏らしていたり、誤字などが多くみられました。
ですが、とりあえず作成できてよかったです。

参考資料

学習にちょうど良いWebアプリを作成【SpringBoot+Thymeleaf+PostgreSQL】

0
0
1

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