質問するログイン新規登録

質問編集履歴

3

追記

2019/07/16 11:39

投稿

javava
javava

スコア19

title CHANGED
File without changes
body CHANGED
@@ -123,13 +123,4 @@
123
123
  return eigo;
124
124
  }
125
125
  }
126
- ```
127
- 上記のtbl_nameの部分は間違いでした
128
- 本来のテーブルネームにしたら下記のエラーが出ました
129
- ```ここに言語を入力
130
-
131
- 2019-07-16 16:53:49.822 WARN 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 01S00
132
- 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.
133
- 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
134
-
135
126
  ```

2

追記

2019/07/16 11:39

投稿

javava
javava

スコア19

title CHANGED
File without changes
body CHANGED
@@ -123,4 +123,13 @@
123
123
  return eigo;
124
124
  }
125
125
  }
126
+ ```
127
+ 上記のtbl_nameの部分は間違いでした
128
+ 本来のテーブルネームにしたら下記のエラーが出ました
129
+ ```ここに言語を入力
130
+
131
+ 2019-07-16 16:53:49.822 WARN 10204 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 01S00
132
+ 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.
133
+ 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
134
+
126
135
  ```

1

追記

2019/07/16 08:01

投稿

javava
javava

スコア19

title CHANGED
File without changes
body CHANGED
@@ -53,4 +53,74 @@
53
53
  sts-4.3.0
54
54
  java-12
55
55
 
56
- ご教授お願いします。
56
+ ご教授お願いします。
57
+
58
+ 追記
59
+ ---
60
+ ```ここに言語を入力
61
+ package com.example.demo;
62
+
63
+ import java.util.List;
64
+
65
+ import org.springframework.beans.factory.annotation.Autowired;
66
+ import org.springframework.web.bind.annotation.RequestMapping;
67
+ import org.springframework.web.bind.annotation.RestController;
68
+
69
+
70
+
71
+ @RestController
72
+ public class MainController {
73
+
74
+ @Autowired
75
+ private tblRepository tblRe;
76
+
77
+ @RequestMapping(value = "/test1")
78
+ public List<tbl_sample> get() {
79
+ return tblRe.findAll();
80
+ }
81
+
82
+ }
83
+ ```
84
+
85
+ ```ここに言語を入力
86
+ package com.example.demo;
87
+
88
+ import org.springframework.data.jpa.repository.JpaRepository;
89
+
90
+ public interface tblRepository extends JpaRepository<tbl_sample,String> {
91
+
92
+ }
93
+
94
+ ```
95
+
96
+ ```ここに言語を入力
97
+ package com.example.demo;
98
+
99
+ import javax.persistence.Entity;
100
+ import javax.persistence.Id;
101
+ import javax.persistence.Table;
102
+
103
+ @Entity
104
+ @Table(name="tbl_name")
105
+ public class tbl_sample {
106
+
107
+ @Id
108
+ private String id;
109
+
110
+ private String kokugo;
111
+
112
+ private String eigo;
113
+
114
+ public String getId(){
115
+ return id;
116
+ }
117
+
118
+ public String getKokugo() {
119
+ return kokugo;
120
+ }
121
+
122
+ public String getEigo() {
123
+ return eigo;
124
+ }
125
+ }
126
+ ```