質問編集履歴

3

pom.xmlの変更

2022/03/14 12:02

投稿

asukamaru
asukamaru

スコア10

test CHANGED
File without changes
test CHANGED
@@ -153,21 +153,23 @@
153
153
  <scope>test</scope>
154
154
  </dependency>
155
155
  <dependency>
156
- <groupId>com.h2database</groupId>
156
+ <groupId>com.h2database</groupId>
157
- <artifactId>h2</artifactId>
157
+ <artifactId>h2</artifactId>
158
- <scope>runtime</scope>
158
+ <scope>runtime</scope>
159
- </dependency>
159
+ </dependency>
160
160
  <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
161
- <dependency>
161
+ <dependency>
162
- <groupId>mysql</groupId>
162
+ <groupId>mysql</groupId>
163
- <artifactId>mysql-connector-java</artifactId>
163
+ <artifactId>mysql-connector-java</artifactId>
164
- <version>8.0.17</version>
164
+ <version>8.0.17</version>
165
- <scope>runtime</scope>
165
+ <scope>runtime</scope>
166
- </dependency>
166
+ </dependency>
167
- <dependency>
167
+ <dependency>
168
- <groupId>org.springframework.boot</groupId>
168
+ <groupId>org.springframework.boot</groupId>
169
- <artifactId>spring-boot-starter-data-jpa</artifactId>
169
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
170
- </dependency>
170
+ </dependency>
171
+
172
+
171
173
  </dependencies>
172
174
 
173
175
  <build>
@@ -180,4 +182,5 @@
180
182
  </build>
181
183
 
182
184
  </project>
185
+
183
186
  ```

2

pom.xmlのコードの追加

2022/03/14 12:00

投稿

asukamaru
asukamaru

スコア10

test CHANGED
File without changes
test CHANGED
@@ -101,3 +101,83 @@
101
101
  </body>
102
102
  </html>
103
103
  ```
104
+ #pom.xml
105
+ ```ここに言語を入力
106
+ <?xml version="1.0" encoding="UTF-8"?>
107
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
108
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
109
+ <modelVersion>4.0.0</modelVersion>
110
+ <parent>
111
+ <groupId>org.springframework.boot</groupId>
112
+ <artifactId>spring-boot-starter-parent</artifactId>
113
+ <version>2.6.4</version>
114
+ <relativePath/> <!-- lookup parent from repository -->
115
+ </parent>
116
+ <groupId>com.example</groupId>
117
+ <artifactId>spring</artifactId>
118
+ <version>0.0.1-SNAPSHOT</version>
119
+ <name>spring</name>
120
+ <description>Demo project for Spring Boot</description>
121
+ <properties>
122
+ <java.version>11</java.version>
123
+ </properties>
124
+ <dependencies>
125
+ <dependency>
126
+ <groupId>org.springframework.boot</groupId>
127
+ <artifactId>spring-boot-starter-jdbc</artifactId>
128
+ </dependency>
129
+
130
+ <dependency>
131
+ <groupId>org.springframework.boot</groupId>
132
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
133
+ </dependency>
134
+ <dependency>
135
+ <groupId>org.springframework.boot</groupId>
136
+ <artifactId>spring-boot-starter-web</artifactId>
137
+ </dependency>
138
+
139
+ <dependency>
140
+ <groupId>org.springframework.boot</groupId>
141
+ <artifactId>spring-boot-devtools</artifactId>
142
+ <scope>runtime</scope>
143
+ <optional>true</optional>
144
+ </dependency>
145
+ <dependency>
146
+ <groupId>mysql</groupId>
147
+ <artifactId>mysql-connector-java</artifactId>
148
+ <scope>runtime</scope>
149
+ </dependency>
150
+ <dependency>
151
+ <groupId>org.springframework.boot</groupId>
152
+ <artifactId>spring-boot-starter-test</artifactId>
153
+ <scope>test</scope>
154
+ </dependency>
155
+ <dependency>
156
+ <groupId>com.h2database</groupId>
157
+ <artifactId>h2</artifactId>
158
+ <scope>runtime</scope>
159
+ </dependency>
160
+ <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
161
+ <dependency>
162
+ <groupId>mysql</groupId>
163
+ <artifactId>mysql-connector-java</artifactId>
164
+ <version>8.0.17</version>
165
+ <scope>runtime</scope>
166
+ </dependency>
167
+ <dependency>
168
+ <groupId>org.springframework.boot</groupId>
169
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
170
+ </dependency>
171
+ </dependencies>
172
+
173
+ <build>
174
+ <plugins>
175
+ <plugin>
176
+ <groupId>org.springframework.boot</groupId>
177
+ <artifactId>spring-boot-maven-plugin</artifactId>
178
+ </plugin>
179
+ </plugins>
180
+ </build>
181
+
182
+ </project>
183
+ ```

1

リンクが見れなかったので、employee_tbl詳細を追加しました。

2022/03/14 07:05

投稿

asukamaru
asukamaru

スコア10

test CHANGED
File without changes
test CHANGED
@@ -2,10 +2,17 @@
2
2
  MySQLで作成したテーブルを表示させたいです。
3
3
  画面遷移はできますが、何も表示されない状態です。
4
4
 
5
- 下記リンク参考にしてemployee_tblは作成済みです。
5
+ 行き詰ってしまったで、アドバイス頂きたいです。
6
- [https://confrage.jp/spring-boot-gradle-jpa%E3%81%A7mysql%E3%81%AB%E6%8E%A5%E7%B6%9A%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/](url)
7
6
 
8
- 行き詰ってしまったので、アドバイスを頂きたいです。
7
+ #テーブル(employee_tbl)
8
+ |empno|empname|
9
+ |:--|:--:|
10
+ |1|従業員A
11
+ 2|従業員B
12
+ 3|従業員C
13
+ 4|従業員Ⅾ
14
+
15
+
9
16
 
10
17
  #エンティティ
11
18
  ```ここに言語を入力