質問編集履歴

3

codeに入ってない文字があったので修正

2020/08/22 04:51

投稿

kaibasira
kaibasira

スコア15

test CHANGED
File without changes
test CHANGED
@@ -294,7 +294,9 @@
294
294
 
295
295
  中身のcreate tableです
296
296
 
297
+ ```
298
+
297
- ```create table movie(
299
+ create table movie(
298
300
 
299
301
  movie_number int,
300
302
 

2

create tableを追加

2020/08/22 04:51

投稿

kaibasira
kaibasira

スコア15

test CHANGED
File without changes
test CHANGED
@@ -280,10 +280,6 @@
280
280
 
281
281
 
282
282
 
283
-
284
-
285
-
286
-
287
283
  ```
288
284
 
289
285
  このようなエラーが出てしまいます。
@@ -296,6 +292,128 @@
296
292
 
297
293
 
298
294
 
295
+ 中身のcreate tableです
296
+
297
+ ```create table movie(
298
+
299
+ movie_number int,
300
+
301
+ title_name varchar(400) not null,
302
+
303
+ years_publication char(4) not null,
304
+
305
+ performance_income varchar(50) not null,
306
+
307
+ production_cost varchar(50) not null,
308
+
309
+ public_evaluation double not null,
310
+
311
+ screening_time varchar(10) not null,
312
+
313
+ genre_number int not null,
314
+
315
+ directed_number int not null,
316
+
317
+ original_number varchar(400) not null,
318
+
319
+ cast_number int not null,
320
+
321
+ constraint MV primary key(movie_number),
322
+
323
+ constraint FK_1 foreign key(genre_number) references genre_list(genre_number),
324
+
325
+
326
+
327
+ constraint FK_2 foreign key(directed_number) references directed_list(directed_number),
328
+
329
+
330
+
331
+ constraint FK_3 foreign key(original_number) references original_list(original_number),
332
+
333
+ constraint FK_4 foreign key(cast_number) references cast_list(cast_number));
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+ create table genre_list(
348
+
349
+ genre_name varchar(400) not null ,
350
+
351
+ genre_number int auto_increment ,
352
+
353
+ constraint GN primary key(genre_number));
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+ create table directed_list(
362
+
363
+ directed_name varchar(400) not null ,
364
+
365
+ directed_number int auto_increment ,
366
+
367
+ constraint DI primary key(directed_number));
368
+
369
+
370
+
371
+ create table original_list(
372
+
373
+ original_name varchar(400) not null ,
374
+
375
+ original_number int auto_increment ,
376
+
377
+ constraint OI primary key(original_number));
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+ create table prodction_list(
386
+
387
+ prodction_name varchar(400) not null ,
388
+
389
+ prodction_number int auto_increment,
390
+
391
+ constraint PR primary key(prodction_number));
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+ create table cast_list(
406
+
407
+ cast_name varchar(400) not null ,
408
+
409
+ cast_number int auto_increment,
410
+
411
+ constraint MA primary key(cast_number));
412
+
413
+ ```
414
+
415
+
416
+
299
417
 
300
418
 
301
419
  検索画面はこのようなイメージです

1

トムキャットのエラーコードをcodeに修正

2020/08/22 04:50

投稿

kaibasira
kaibasira

スコア15

test CHANGED
File without changes
test CHANGED
@@ -198,12 +198,106 @@
198
198
 
199
199
 
200
200
 
201
+ ```
202
+
203
+ Hello
204
+
205
+ java.sql.SQLSyntaxErrorException: SQL構文エラーです。バージョンに対応するマニュアルを参照して正しい構文を確認してください。 : 'title_name like 'ア%'' 付近 1 行目
206
+
207
+ at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
208
+
209
+ at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
210
+
211
+ at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
212
+
213
+ at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
214
+
215
+ at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
216
+
217
+ at movie.Model.execute(Model.java:55)
218
+
201
- ![イメージ説明](c99d23c0edf94d8b2918a74beb5426da.png)
219
+ at movie.Controller.doPost(Controller.java:33)
220
+
202
-
221
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
222
+
203
-
223
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
224
+
225
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
226
+
227
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
228
+
229
+ at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
230
+
231
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
232
+
233
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
234
+
235
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
236
+
237
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
238
+
239
+ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
240
+
241
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
242
+
243
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
244
+
245
+ at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
246
+
247
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
248
+
249
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
250
+
251
+ at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
252
+
253
+ at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
254
+
255
+ at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
256
+
257
+ at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
258
+
259
+ at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
260
+
261
+ at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
262
+
263
+ at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
264
+
265
+ at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
266
+
267
+ at java.base/java.lang.Thread.run(Thread.java:832)
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+ ```
204
288
 
205
289
  このようなエラーが出てしまいます。
206
290
 
207
291
 
208
292
 
209
293
  前方一致の検索なのですがsql構文をどうしたらうまく通るでしょうか?
294
+
295
+
296
+
297
+
298
+
299
+
300
+
301
+ 検索画面はこのようなイメージです
302
+
303
+ ![イメージ説明](c8147bd8887a428734904dc17bf22f45.png)