質問編集履歴

3

追記

2019/07/16 11:39

投稿

javava
javava

スコア19

test CHANGED
File without changes
test CHANGED
@@ -249,21 +249,3 @@
249
249
  }
250
250
 
251
251
  ```
252
-
253
- 上記のtbl_nameの部分は間違いでした
254
-
255
- 本来のテーブルネームにしたら下記のエラーが出ました
256
-
257
- ```ここに言語を入力
258
-
259
-
260
-
261
- 2019-07-16 16:53:49.822 WARN 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 01S00
262
-
263
- 2019-07-16 16:53:49.822 ERROR 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : The server time zone value '���� (�W����)' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
264
-
265
- 2019-07-16 16:53:49.835 ERROR 10204 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection] with root cause
266
-
267
-
268
-
269
- ```

2

追記

2019/07/16 11:39

投稿

javava
javava

スコア19

test CHANGED
File without changes
test CHANGED
@@ -249,3 +249,21 @@
249
249
  }
250
250
 
251
251
  ```
252
+
253
+ 上記のtbl_nameの部分は間違いでした
254
+
255
+ 本来のテーブルネームにしたら下記のエラーが出ました
256
+
257
+ ```ここに言語を入力
258
+
259
+
260
+
261
+ 2019-07-16 16:53:49.822 WARN 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 01S00
262
+
263
+ 2019-07-16 16:53:49.822 ERROR 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : The server time zone value '���� (�W����)' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
264
+
265
+ 2019-07-16 16:53:49.835 ERROR 10204 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection] with root cause
266
+
267
+
268
+
269
+ ```

1

追記

2019/07/16 08:01

投稿

javava
javava

スコア19

test CHANGED
File without changes
test CHANGED
@@ -109,3 +109,143 @@
109
109
 
110
110
 
111
111
  ご教授お願いします。
112
+
113
+
114
+
115
+ 追記
116
+
117
+ ---
118
+
119
+ ```ここに言語を入力
120
+
121
+ package com.example.demo;
122
+
123
+
124
+
125
+ import java.util.List;
126
+
127
+
128
+
129
+ import org.springframework.beans.factory.annotation.Autowired;
130
+
131
+ import org.springframework.web.bind.annotation.RequestMapping;
132
+
133
+ import org.springframework.web.bind.annotation.RestController;
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ @RestController
142
+
143
+ public class MainController {
144
+
145
+
146
+
147
+ @Autowired
148
+
149
+ private tblRepository tblRe;
150
+
151
+
152
+
153
+ @RequestMapping(value = "/test1")
154
+
155
+ public List<tbl_sample> get() {
156
+
157
+ return tblRe.findAll();
158
+
159
+ }
160
+
161
+
162
+
163
+ }
164
+
165
+ ```
166
+
167
+
168
+
169
+ ```ここに言語を入力
170
+
171
+ package com.example.demo;
172
+
173
+
174
+
175
+ import org.springframework.data.jpa.repository.JpaRepository;
176
+
177
+
178
+
179
+ public interface tblRepository extends JpaRepository<tbl_sample,String> {
180
+
181
+
182
+
183
+ }
184
+
185
+
186
+
187
+ ```
188
+
189
+
190
+
191
+ ```ここに言語を入力
192
+
193
+ package com.example.demo;
194
+
195
+
196
+
197
+ import javax.persistence.Entity;
198
+
199
+ import javax.persistence.Id;
200
+
201
+ import javax.persistence.Table;
202
+
203
+
204
+
205
+ @Entity
206
+
207
+ @Table(name="tbl_name")
208
+
209
+ public class tbl_sample {
210
+
211
+
212
+
213
+ @Id
214
+
215
+ private String id;
216
+
217
+
218
+
219
+ private String kokugo;
220
+
221
+
222
+
223
+ private String eigo;
224
+
225
+
226
+
227
+ public String getId(){
228
+
229
+ return id;
230
+
231
+ }
232
+
233
+
234
+
235
+ public String getKokugo() {
236
+
237
+ return kokugo;
238
+
239
+ }
240
+
241
+
242
+
243
+ public String getEigo() {
244
+
245
+ return eigo;
246
+
247
+ }
248
+
249
+ }
250
+
251
+ ```