質問編集履歴

2

pom.xml、 application.properties の内容を追記しました。

2018/09/01 01:41

投稿

s_akira
s_akira

スコア15

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,156 @@
54
54
 
55
55
 
56
56
 
57
+ pom.xml
58
+
59
+ ```XML
60
+
61
+ <?xml version="1.0" encoding="UTF-8"?>
62
+
63
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
64
+
65
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
66
+
67
+ <modelVersion>4.0.0</modelVersion>
68
+
69
+
70
+
71
+ <groupId>com.example</groupId>
72
+
73
+ <artifactId>demo</artifactId>
74
+
75
+ <version>0.0.1-SNAPSHOT</version>
76
+
77
+ <packaging>jar</packaging>
78
+
79
+
80
+
81
+ <name>demo</name>
82
+
83
+ <description>Demo project for Spring Boot</description>
84
+
85
+
86
+
87
+ <parent>
88
+
89
+ <groupId>org.springframework.boot</groupId>
90
+
91
+ <artifactId>spring-boot-starter-parent</artifactId>
92
+
93
+ <version>2.0.4.RELEASE</version>
94
+
95
+ <relativePath/> <!-- lookup parent from repository -->
96
+
97
+ </parent>
98
+
99
+
100
+
101
+ <properties>
102
+
103
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
104
+
105
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
106
+
107
+ <java.version>1.8</java.version>
108
+
109
+ </properties>
110
+
111
+ <dependencies>
112
+
113
+
114
+
115
+ <dependency>
116
+
117
+ <groupId>org.springframework.boot</groupId>
118
+
119
+ <artifactId>spring-boot-starter-jdbc</artifactId>
120
+
121
+ </dependency>
122
+
123
+ <dependency>
124
+
125
+ <groupId>org.springframework.boot</groupId>
126
+
127
+ <artifactId>spring-boot-starter-thymeleaf</artifactId>
128
+
129
+ </dependency>
130
+
131
+ <dependency>
132
+
133
+ <groupId>org.springframework.boot</groupId>
134
+
135
+ <artifactId>spring-boot-starter-web</artifactId>
136
+
137
+ </dependency>
138
+
139
+
140
+
141
+ <dependency>
142
+
143
+ <groupId>org.postgresql</groupId>
144
+
145
+ <artifactId>postgresql</artifactId>
146
+
147
+ <scope>runtime</scope>
148
+
149
+ </dependency>
150
+
151
+ <dependency>
152
+
153
+ <groupId>org.springframework.boot</groupId>
154
+
155
+ <artifactId>spring-boot-starter-test</artifactId>
156
+
157
+ <scope>test</scope>
158
+
159
+ </dependency>
160
+
161
+ </dependencies>
162
+
163
+
164
+
165
+ <build>
166
+
167
+ <plugins>
168
+
169
+ <plugin>
170
+
171
+ <groupId>org.springframework.boot</groupId>
172
+
173
+ <artifactId>spring-boot-maven-plugin</artifactId>
174
+
175
+ </plugin>
176
+
177
+ </plugins>
178
+
179
+ </build>
180
+
181
+
182
+
183
+
184
+
185
+ </project>
186
+
187
+
188
+
189
+ ```
190
+
191
+
192
+
57
- 参考先の通り、pomとapplication.propertiesに必要事項は記載しています。
193
+ application.properties
194
+
195
+ ```properties
196
+
197
+ spring.datasource.driver-class-name=org.postgresql.Driver
198
+
199
+ spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
200
+
201
+ spring.datasource.username=postgres
202
+
203
+ spring.datasource.password=password
204
+
205
+ ```
206
+
207
+
58
208
 
59
209
  初歩的なことで申し訳ないのですが、解決方法を教えていただきたいです。

1

修正

2018/09/01 01:41

投稿

s_akira
s_akira

スコア15

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [Spring boot 入門 DB 接続する簡単な Web アプリを作成](https://www.shookuro.com/entry/2017/11/23/121436)
4
4
 
5
+ を参考に接続しようとしています。
6
+
5
- 参考に接続していすが'dataSource'エラー(?)が表示されてしまいます。
7
+ 参考記事の通り行っているつもりなのですが'dataSource'エラー(?)が表示されてしまいます。
6
8
 
7
9
  Error内容一部省略しております。
8
10