4-5能出现添加了水印的文件,但没办法添加数据库

来源:4-5 店铺注册之Service层的实现

韬1430337

2020-09-09

图片描述

这个如果把updateShop换成insertShop的话就不会出错

2020-09-09 19:04:21:304[main] INFO o.s.t.c.support.DefaultTestContextBootstrapper-Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
2020-09-09 19:04:21:326[main] INFO o.s.t.c.support.DefaultTestContextBootstrapper-Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@581ac8a8, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@6d4e5011, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@57d7f8ca, org.springframework.test.context.support.DirtiesContextTestExecutionListener@76c3e77a, org.springframework.test.context.transaction.TransactionalTestExecutionListener@78123e82, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@67c33749]
2020-09-09 19:04:21:880[MLog-Init-Reporter] INFO com.mchange.v2.log.MLog-MLog clients using slf4j logging.
2020-09-09 19:04:22:318[main] INFO com.mchange.v2.c3p0.C3P0Registry-Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10]
2020-09-09 19:04:22:869[main] INFO c.m.v2.c3p0.impl.AbstractPoolBackedDataSource-Initializing c3p0 pool… com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 2, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 10000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 2s0f17acvs35i5n336br|664a9613, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 2s0f17acvs35i5n336br|664a9613, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/020?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 30, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
2020-09-09 19:04:22:894[main] WARN com.mchange.v2.resourcepool.BasicResourcePool-Bad pool size config, start 3 < min 10. Using 10 as start.
2020-09-09 19:04:23:127[main] DEBUG com.imooc.o2o.dao.ShopDao.insertShop-> Preparing: INSERT INTO tb_shop(owner_id,area_id,shop_category_id,shop_name,shop_desc,shop_addr, phone,shop_img,priority,create_time,last_edit_time,enable_status,advice) VALUES (?,?,?, ?,?,?,?,?, ?,?,?, ?,?)
2020-09-09 19:04:23:166[main] DEBUG com.imooc.o2o.dao.ShopDao.insertShop-> Parameters: 1(Long), 2(Integer), 1(Long), 测试的店铺1(String), test1(String), test1(String), test1(String), null, null, 2020-09-09 19:04:23.102(Timestamp), 2020-09-09 19:04:23.102(Timestamp), 0(Integer), 审核中(String)
2020-09-09 19:04:23:167[main] DEBUG com.imooc.o2o.dao.ShopDao.insertShop-<== Updates: 1
2020-09-09 19:04:23:187[main] DEBUG com.imooc.o2o.util.ImageUtil-current relativeDaar is:upload\item\shop\37\2020-09-09-19-04-2333581.jpg
2020-09-09 19:04:23:187[main] DEBUG com.imooc.o2o.util.ImageUtil-current complete addr is:D:\IMGupload\item\shop\37\2020-09-09-19-04-2333581.jpg
2020-09-09 19:04:41:926[main] DEBUG com.imooc.o2o.dao.ShopDao.updateShop-==> Preparing: update tb_shop SET shop_name=?, shop_desc=?, shop_addr=?, phone=?, shop_img=?, enable_status=?, advice=?, area_id=?, shop_category_id=? where shop_id=?

写回答

1回答

翔仔

2020-09-10

相关问题已在 http://coding.imooc.com/learn/questiondetail/204545.html 解答,同学可以对比一下视频里面的mapper,感觉你的sql里面的key配错了 可以一步步调试看看有没有异常

0
2
韬1430337
终于完成了,真的是烧脑
2020-09-10
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5127 学习 · 8149 问题

查看课程