質問編集履歴
17
文言修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -348,7 +348,7 @@
|
|
348
348
|
|
349
349
|
```
|
350
350
|
|
351
|
-
こちらは
|
351
|
+
こちらはデータが表示されます。
|
352
352
|
|
353
353
|
```
|
354
354
|
|
16
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -152,18 +152,12 @@
|
|
152
152
|
|
153
153
|
10 23, 2018 10:49:06 午後 org.apache.jasper.servlet.TldScanner scanJars
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
|
155
|
+
略
|
156
|
+
|
157
|
+
情報: Starting ProtocolHandler ["http-nio-8080"]
|
160
158
|
|
161
159
|
10 23, 2018 10:49:06 午後 org.apache.coyote.AbstractProtocol start
|
162
160
|
|
163
|
-
情報: Starting ProtocolHandler ["http-nio-8080"]
|
164
|
-
|
165
|
-
10 23, 2018 10:49:06 午後 org.apache.coyote.AbstractProtocol start
|
166
|
-
|
167
161
|
情報: Starting ProtocolHandler ["ajp-nio-8009"]
|
168
162
|
|
169
163
|
|
@@ -206,18 +200,6 @@
|
|
206
200
|
|
207
201
|
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
|
208
202
|
|
209
|
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
|
210
|
-
|
211
|
-
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
|
212
|
-
|
213
|
-
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
|
214
|
-
|
215
|
-
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
|
216
|
-
|
217
|
-
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
|
218
|
-
|
219
|
-
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
|
220
|
-
|
221
203
|
at
|
222
204
|
|
223
205
|
略
|
@@ -366,6 +348,88 @@
|
|
366
348
|
|
367
349
|
```
|
368
350
|
|
351
|
+
こちらはつながります。
|
352
|
+
|
353
|
+
```
|
354
|
+
|
355
|
+
package chapter6;
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
import java.sql.*;
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
public class MySqlTest {
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
public static void main(String[] args) {
|
368
|
+
|
369
|
+
Connection con = null;
|
370
|
+
|
371
|
+
try {
|
372
|
+
|
373
|
+
// JDBCドライバのロード - JDBC4.0(JDK1.6)以降は不要
|
374
|
+
|
375
|
+
Class.forName("com.mysql.jdbc.Driver").newInstance();
|
376
|
+
|
377
|
+
// MySQLに接続
|
378
|
+
|
379
|
+
con = DriverManager.getConnection("jdbc:mysql://localhost/SAMPLEDB", "root", "");
|
380
|
+
|
381
|
+
System.out.println("MySQLに接続できました。");
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
Statement stm = con.createStatement();
|
386
|
+
|
387
|
+
String sql = "Select * from student";
|
388
|
+
|
389
|
+
ResultSet rs = stm.executeQuery(sql);
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
while(rs.next()){
|
394
|
+
|
395
|
+
int id = rs.getInt("STUDENTNO");
|
396
|
+
|
397
|
+
String name = rs.getString("STUDENTNAME");
|
398
|
+
|
399
|
+
System.out.println("取得結果 -> " + id + ":" + name);
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
|
408
|
+
|
409
|
+
System.out.println("JDBCドライバのロードに失敗しました。");
|
410
|
+
|
411
|
+
} catch (SQLException e) {
|
412
|
+
|
413
|
+
System.out.println("MySQLに接続できませんでした。");
|
414
|
+
|
415
|
+
} finally {
|
416
|
+
|
417
|
+
略
|
418
|
+
|
419
|
+
}
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
}
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
```
|
432
|
+
|
369
433
|
|
370
434
|
|
371
435
|
tomcatを通してdbに繋がらないと思われませすが、
|
15
バージョン追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,13 @@
|
|
12
12
|
|
13
13
|
eclipse、tomcat、MySQLはインストール済みで、
|
14
14
|
|
15
|
+
下記バージョン使用で、
|
16
|
+
|
17
|
+
jdbcドライバ:mysql-connector-java-8.0.12.jar
|
18
|
+
|
19
|
+
Mysql:Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)
|
20
|
+
|
15
|
-
プロジェクトを作
|
21
|
+
プロジェクトを作り、上記を参考にし、実行すると下記のような結果になります。
|
16
22
|
|
17
23
|
![イメージ説明](bc5a26bba9dd76e67072025ee6f5a10b.png)
|
18
24
|
|
14
エラー修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,6 +36,132 @@
|
|
36
36
|
|
37
37
|
```
|
38
38
|
|
39
|
+
10 23, 2018 10:49:05 午後 org.apache.tomcat.util.digester.SetPropertiesRule begin
|
40
|
+
|
41
|
+
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DBSampleServlet' did not find a matching property.
|
42
|
+
|
43
|
+
10 23, 2018 10:49:05 午後 org.apache.tomcat.util.digester.SetPropertiesRule begin
|
44
|
+
|
45
|
+
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TodoServlet' did not find a matching property.
|
46
|
+
|
47
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
48
|
+
|
49
|
+
情報: Server version: Apache Tomcat/8.0.53
|
50
|
+
|
51
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
52
|
+
|
53
|
+
情報: Server built: Jun 29 2018 14:42:45 UTC
|
54
|
+
|
55
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
56
|
+
|
57
|
+
情報: Server number: 8.0.53.0
|
58
|
+
|
59
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
60
|
+
|
61
|
+
情報: OS Name: Mac OS X
|
62
|
+
|
63
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
64
|
+
|
65
|
+
情報: OS Version: 10.13.6
|
66
|
+
|
67
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
68
|
+
|
69
|
+
情報: Architecture: x86_64
|
70
|
+
|
71
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
72
|
+
|
73
|
+
情報: Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
|
74
|
+
|
75
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
76
|
+
|
77
|
+
情報: JVM Version: 1.8.0_181-b13
|
78
|
+
|
79
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
80
|
+
|
81
|
+
情報: JVM Vendor: Oracle Corporation
|
82
|
+
|
83
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
84
|
+
|
85
|
+
情報: CATALINA_BASE: /Users/sawada/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
|
86
|
+
|
87
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
88
|
+
|
89
|
+
情報: CATALINA_HOME: /Applications/apache-tomcat-8.0.53
|
90
|
+
|
91
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
92
|
+
|
93
|
+
情報: Command line argument: -Dcatalina.base=/Users/sawada/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
|
94
|
+
|
95
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
96
|
+
|
97
|
+
情報: Command line argument: -Dcatalina.home=/Applications/apache-tomcat-8.0.53
|
98
|
+
|
99
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
100
|
+
|
101
|
+
情報: Command line argument: -Dwtp.deploy=/Users/sawada/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
|
102
|
+
|
103
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
104
|
+
|
105
|
+
情報: Command line argument: -Djava.endorsed.dirs=/Applications/apache-tomcat-8.0.53/endorsed
|
106
|
+
|
107
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.VersionLoggerListener log
|
108
|
+
|
109
|
+
情報: Command line argument: -Dfile.encoding=UTF-8
|
110
|
+
|
111
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
|
112
|
+
|
113
|
+
略
|
114
|
+
|
115
|
+
10 23, 2018 10:49:05 午後 org.apache.coyote.AbstractProtocol init
|
116
|
+
|
117
|
+
情報: Initializing ProtocolHandler ["http-nio-8080"]
|
118
|
+
|
119
|
+
10 23, 2018 10:49:05 午後 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
|
120
|
+
|
121
|
+
情報: Using a shared selector for servlet write/read
|
122
|
+
|
123
|
+
10 23, 2018 10:49:05 午後 org.apache.coyote.AbstractProtocol init
|
124
|
+
|
125
|
+
情報: Initializing ProtocolHandler ["ajp-nio-8009"]
|
126
|
+
|
127
|
+
10 23, 2018 10:49:05 午後 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
|
128
|
+
|
129
|
+
情報: Using a shared selector for servlet write/read
|
130
|
+
|
131
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.startup.Catalina load
|
132
|
+
|
133
|
+
情報: Initialization processed in 827 ms
|
134
|
+
|
135
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.core.StandardService startInternal
|
136
|
+
|
137
|
+
情報: サービス Catalina を起動します
|
138
|
+
|
139
|
+
10 23, 2018 10:49:05 午後 org.apache.catalina.core.StandardEngine startInternal
|
140
|
+
|
141
|
+
情報: Starting Servlet Engine: Apache Tomcat/8.0.53
|
142
|
+
|
143
|
+
10 23, 2018 10:49:05 午後 org.apache.jasper.servlet.TldScanner scanJars
|
144
|
+
|
145
|
+
情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
|
146
|
+
|
147
|
+
10 23, 2018 10:49:06 午後 org.apache.jasper.servlet.TldScanner scanJars
|
148
|
+
|
149
|
+
情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
|
150
|
+
|
151
|
+
10 23, 2018 10:49:06 午後 org.apache.jasper.servlet.TldScanner scanJars
|
152
|
+
|
153
|
+
情報: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
|
154
|
+
|
155
|
+
10 23, 2018 10:49:06 午後 org.apache.coyote.AbstractProtocol start
|
156
|
+
|
157
|
+
情報: Starting ProtocolHandler ["http-nio-8080"]
|
158
|
+
|
159
|
+
10 23, 2018 10:49:06 午後 org.apache.coyote.AbstractProtocol start
|
160
|
+
|
161
|
+
情報: Starting ProtocolHandler ["ajp-nio-8009"]
|
162
|
+
|
163
|
+
|
164
|
+
|
39
165
|
10 23, 2018 10:49:06 午後 org.apache.catalina.startup.Catalina start
|
40
166
|
|
41
167
|
情報: Server startup in 1223 ms
|
@@ -86,65 +212,9 @@
|
|
86
212
|
|
87
213
|
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
|
88
214
|
|
89
|
-
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
|
90
|
-
|
91
|
-
at java.sql.DriverManager.getConnection(DriverManager.java:664)
|
92
|
-
|
93
|
-
at java.sql.DriverManager.getConnection(DriverManager.java:247)
|
94
|
-
|
95
|
-
at chapter6.SelectSampleServlet.doGet(SelectSampleServlet.java:48)
|
96
|
-
|
97
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
|
98
|
-
|
99
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
|
100
|
-
|
101
|
-
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
|
102
|
-
|
103
|
-
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
104
|
-
|
105
|
-
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
|
106
|
-
|
107
|
-
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
|
108
|
-
|
109
|
-
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
110
|
-
|
111
|
-
at filter.EncodingFileter.doFilter(EncodingFileter.java:30)
|
112
|
-
|
113
|
-
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
|
114
|
-
|
115
|
-
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
116
|
-
|
117
|
-
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
|
118
|
-
|
119
|
-
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
|
120
|
-
|
121
|
-
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
|
122
|
-
|
123
|
-
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
|
124
|
-
|
125
|
-
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
|
126
|
-
|
127
|
-
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
|
128
|
-
|
129
|
-
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
|
130
|
-
|
131
|
-
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
|
132
|
-
|
133
|
-
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
|
134
|
-
|
135
|
-
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
|
136
|
-
|
137
|
-
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
|
138
|
-
|
139
|
-
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
|
140
|
-
|
141
|
-
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
142
|
-
|
143
|
-
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
144
|
-
|
145
|
-
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
|
146
|
-
|
147
|
-
at
|
215
|
+
at
|
216
|
+
|
217
|
+
略
|
148
218
|
|
149
219
|
|
150
220
|
|
@@ -156,41 +226,15 @@
|
|
156
226
|
|
157
227
|
一応ソースは下記になります(参考にしたサイトとほとんど同じです)
|
158
228
|
|
229
|
+
文字数制限のため一部省きます。上記参考サイトをご覧ください。
|
230
|
+
|
159
231
|
```java
|
160
232
|
|
161
233
|
package chapter6;
|
162
234
|
|
163
235
|
|
164
236
|
|
165
|
-
import java.io.IOException;
|
166
|
-
|
167
|
-
import java.io.PrintWriter;
|
168
|
-
|
169
|
-
import java.sql.DriverManager;
|
170
|
-
|
171
|
-
|
237
|
+
略
|
172
|
-
|
173
|
-
import java.sql.SQLException;
|
174
|
-
|
175
|
-
import java.sql.Statement;
|
176
|
-
|
177
|
-
import java.util.ArrayList;
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
import javax.servlet.ServletException;
|
182
|
-
|
183
|
-
import javax.servlet.annotation.WebServlet;
|
184
|
-
|
185
|
-
import javax.servlet.http.HttpServlet;
|
186
|
-
|
187
|
-
import javax.servlet.http.HttpServletRequest;
|
188
|
-
|
189
|
-
import javax.servlet.http.HttpServletResponse;
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
238
|
|
195
239
|
|
196
240
|
|
@@ -310,55 +354,7 @@
|
|
310
354
|
|
311
355
|
}
|
312
356
|
|
313
|
-
PrintWriter out = response.getWriter();
|
314
|
-
|
315
|
-
out.println("<html>");
|
316
|
-
|
317
|
-
out.println("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
|
318
|
-
|
319
|
-
out.println("<head><title>" + "データベース接続のサンプルサーブレットSelect" + "</title></head>");
|
320
|
-
|
321
|
-
out.println("<body>");
|
322
|
-
|
323
|
-
out.println("<table border=1>");
|
324
|
-
|
325
|
-
out.println("<tr><th>学籍番号</th>" + "<th>学生氏名</th>" + "<th>学年</th></tr>");
|
326
|
-
|
327
|
-
for (String str : list) {
|
328
|
-
|
329
|
-
out.println("<tr>" + str + "</tr>");
|
330
|
-
|
331
|
-
|
357
|
+
略
|
332
|
-
|
333
|
-
out.print("</table>");
|
334
|
-
|
335
|
-
out.println("</body>");
|
336
|
-
|
337
|
-
out.println("</html>");
|
338
|
-
|
339
|
-
}
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
/**
|
344
|
-
|
345
|
-
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
|
346
|
-
|
347
|
-
* response)
|
348
|
-
|
349
|
-
*/
|
350
|
-
|
351
|
-
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
352
|
-
|
353
|
-
throws ServletException, IOException {
|
354
|
-
|
355
|
-
// TODO Auto-generated method stub
|
356
|
-
|
357
|
-
doGet(request, response);
|
358
|
-
|
359
|
-
}
|
360
|
-
|
361
|
-
|
362
358
|
|
363
359
|
}
|
364
360
|
|
13
エラーメッセージの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,59 +36,93 @@
|
|
36
36
|
|
37
37
|
```
|
38
38
|
|
39
|
-
10 23, 2018
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
(
|
39
|
+
10 23, 2018 10:49:06 午後 org.apache.catalina.startup.Catalina start
|
40
|
+
|
41
|
+
情報: Server startup in 1223 ms
|
42
|
+
|
43
|
+
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
|
44
|
+
|
45
|
+
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
|
46
|
+
|
47
|
+
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
|
48
|
+
|
49
|
+
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
|
50
|
+
|
51
|
+
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
|
52
|
+
|
53
|
+
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
|
54
|
+
|
55
|
+
at com.mysql.jdbc.Util.getInstance(Util.java:381)
|
56
|
+
|
57
|
+
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
|
58
|
+
|
59
|
+
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
|
60
|
+
|
61
|
+
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
|
62
|
+
|
63
|
+
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
|
64
|
+
|
65
|
+
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
|
66
|
+
|
67
|
+
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3996)
|
68
|
+
|
69
|
+
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1284)
|
70
|
+
|
71
|
+
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2142)
|
72
|
+
|
73
|
+
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:781)
|
74
|
+
|
75
|
+
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
|
76
|
+
|
77
|
+
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
|
78
|
+
|
79
|
+
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
|
80
|
+
|
81
|
+
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
|
82
|
+
|
83
|
+
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
|
84
|
+
|
85
|
+
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
|
86
|
+
|
87
|
+
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
|
88
|
+
|
89
|
+
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
|
90
|
+
|
91
|
+
at java.sql.DriverManager.getConnection(DriverManager.java:664)
|
92
|
+
|
93
|
+
at java.sql.DriverManager.getConnection(DriverManager.java:247)
|
94
|
+
|
95
|
+
at chapter6.SelectSampleServlet.doGet(SelectSampleServlet.java:48)
|
96
|
+
|
97
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
|
98
|
+
|
99
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
|
100
|
+
|
101
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
|
102
|
+
|
103
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
104
|
+
|
105
|
+
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
|
106
|
+
|
107
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
|
108
|
+
|
109
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
110
|
+
|
111
|
+
at filter.EncodingFileter.doFilter(EncodingFileter.java:30)
|
112
|
+
|
113
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
|
114
|
+
|
115
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
|
116
|
+
|
117
|
+
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
|
118
|
+
|
119
|
+
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
|
120
|
+
|
121
|
+
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
|
122
|
+
|
123
|
+
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
|
124
|
+
|
125
|
+
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
|
92
126
|
|
93
127
|
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
|
94
128
|
|
12
題の変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Java Eclipseで動的 Webプロジェクト
|
1
|
+
Java Eclipseで動的 Webプロジェクトが正常に動作しない。
|
test
CHANGED
File without changes
|
11
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,12 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
時間が経つと以下のメッセージが出ました。
|
22
|
+
|
23
|
+
![イメージ説明](e83c5c21c7f62afd3e079da47fd68db4.png)
|
24
|
+
|
25
|
+
|
26
|
+
|
21
27
|
デバッグすると、
|
22
28
|
|
23
29
|
conn = DriverManager.getConnection("jdbc:mysql://localhost/SAMPLEDB", "root", "");
|
10
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -328,7 +328,7 @@
|
|
328
328
|
|
329
329
|
tomcatを通してdbに繋がらないと思われませすが、
|
330
330
|
|
331
|
-
tomcatは起動してdbに繋がらないのをどうやって解決したらいいかわかりません。
|
331
|
+
tomcatは起動しているように見えますがdbに繋がらないのをどうやって解決したらいいかわかりません。
|
332
332
|
|
333
333
|
|
334
334
|
|
9
変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,79 +30,71 @@
|
|
30
30
|
|
31
31
|
```
|
32
32
|
|
33
|
-
10 23, 2018 4
|
33
|
+
10 23, 2018 5:27:41 午後 org.apache.tomcat.util.digester.SetPropertiesRule begin
|
34
34
|
|
35
35
|
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:tomcat_test' did not find a matching property.
|
36
36
|
|
37
|
-
10 23, 2018 4
|
37
|
+
10 23, 2018 5:27:41 午後 org.apache.tomcat.util.digester.SetPropertiesRule begin
|
38
38
|
|
39
39
|
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DBSampleServlet' did not find a matching property.
|
40
40
|
|
41
|
-
10 23, 2018 4
|
41
|
+
10 23, 2018 5:27:41 午後 org.apache.tomcat.util.digester.SetPropertiesRule begin
|
42
42
|
|
43
43
|
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TodoServlet' did not find a matching property.
|
44
44
|
|
45
|
-
10 23, 2018 4
|
45
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
46
46
|
|
47
47
|
情報: Server version: Apache Tomcat/8.0.53
|
48
48
|
|
49
|
-
10 23, 2018 4
|
49
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
50
50
|
|
51
51
|
情報: Server built: Jun 29 2018 14:42:45 UTC
|
52
52
|
|
53
|
-
10 23, 2018 4
|
53
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
54
54
|
|
55
55
|
情報: Server number: 8.0.53.0
|
56
56
|
|
57
|
-
10 23, 2018 4
|
57
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
58
58
|
|
59
59
|
情報: OS Name: Mac OS X
|
60
60
|
|
61
|
-
10 23, 2018 4
|
61
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
62
62
|
|
63
63
|
情報: OS Version: 10.13.6
|
64
64
|
|
65
|
-
10 23, 2018 4
|
65
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
66
66
|
|
67
67
|
情報: Architecture: x86_64
|
68
68
|
|
69
|
-
10 23, 2018 4
|
69
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
70
70
|
|
71
71
|
情報: Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
|
72
72
|
|
73
|
-
10 23, 2018 4
|
73
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
74
74
|
|
75
75
|
情報: JVM Version: 1.8.0_181-b13
|
76
76
|
|
77
|
-
10 23, 2018 4
|
77
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
78
78
|
|
79
79
|
情報: JVM Vendor: Oracle Corporation
|
80
80
|
|
81
|
-
10 23, 2018 4
|
81
|
+
10 23, 2018 5:27:41 午後 org.apache.catalina.startup.VersionLoggerListener log
|
82
|
+
|
83
|
+
|
84
|
+
|
82
|
-
|
85
|
+
(途中略)
|
86
|
+
|
83
|
-
|
87
|
+
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
|
88
|
+
|
84
|
-
|
89
|
+
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
|
90
|
+
|
85
|
-
|
91
|
+
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
|
86
|
-
|
87
|
-
|
92
|
+
|
88
|
-
|
89
|
-
10 23, 2018 4:18:26 午後 org.apache.catalina.startup.VersionLoggerListener log
|
90
|
-
|
91
|
-
情報: Command line argument: -Dcatalina.base=/Users/sawada/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0
|
92
|
-
|
93
|
-
10 23, 2018 4:18:26 午後 org.apache.catalina.startup.VersionLoggerListener log
|
94
|
-
|
95
|
-
|
93
|
+
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
|
96
|
-
|
94
|
+
|
97
|
-
|
95
|
+
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
|
98
|
-
|
99
|
-
|
96
|
+
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
|
97
|
+
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
|
106
98
|
|
107
99
|
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
|
108
100
|
|
@@ -114,6 +106,8 @@
|
|
114
106
|
|
115
107
|
at java.lang.Thread.run(Thread.java:748)
|
116
108
|
|
109
|
+
|
110
|
+
|
117
111
|
```
|
118
112
|
|
119
113
|
|
8
文法等修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
conn = DriverManager.getConnection("jdbc:mysql://localhost/SAMPLEDB", "root", "");
|
24
24
|
|
25
|
-
の箇所
|
25
|
+
の箇所から、e.printStackTrace();に移動します。
|
26
26
|
|
27
27
|
|
28
28
|
|
7
リンク修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
8
8
|
|
9
|
+
[リンク内容](http://stroll.hatenablog.com/entry/2015/11/22/154644)
|
10
|
+
|
9
11
|
|
10
12
|
|
11
13
|
eclipse、tomcat、MySQLはインストール済みで、
|
6
文法等修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -116,6 +116,8 @@
|
|
116
116
|
|
117
117
|
|
118
118
|
|
119
|
+
|
120
|
+
|
119
121
|
一応ソースは下記になります(参考にしたサイトとほとんど同じです)
|
120
122
|
|
121
123
|
```java
|
5
リンク修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
下記のサイトを参考にeclipseでプロジェクトを作成して動作確認をしようとしています。
|
6
6
|
|
7
|
-
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
7
|
+
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
8
8
|
|
9
9
|
|
10
10
|
|
@@ -116,8 +116,6 @@
|
|
116
116
|
|
117
117
|
|
118
118
|
|
119
|
-
|
120
|
-
|
121
119
|
一応ソースは下記になります(参考にしたサイトとほとんど同じです)
|
122
120
|
|
123
121
|
```java
|
4
リンク修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
下記のサイトを参考にeclipseでプロジェクトを作成して動作確認をしようとしています。
|
6
6
|
|
7
|
-
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
7
|
+
[http://stroll.hatenablog.com/entry/2015/11/22/154644](http://)
|
8
8
|
|
9
9
|
|
10
10
|
|
3
リンク修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,9 +4,7 @@
|
|
4
4
|
|
5
5
|
下記のサイトを参考にeclipseでプロジェクトを作成して動作確認をしようとしています。
|
6
6
|
|
7
|
-
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
7
|
+
[http://stroll.hatenablog.com/entry/2015/11/22/154644]
|
8
|
-
|
9
|
-
|
10
8
|
|
11
9
|
|
12
10
|
|
2
リンク修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
|
5
5
|
下記のサイトを参考にeclipseでプロジェクトを作成して動作確認をしようとしています。
|
6
6
|
|
7
|
-
http://stroll.hatenablog.com/entry/2015/11/22/154644
|
7
|
+
[http://stroll.hatenablog.com/entry/2015/11/22/154644](http://)
|
8
|
+
|
9
|
+
|
8
10
|
|
9
11
|
|
10
12
|
|
1
文法等修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
コンソールログは
|
27
|
+
コンソールログは途中で止まっているように思えます(途中は文字数超過のため省略)。
|
28
28
|
|
29
29
|
```
|
30
30
|
|