java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94'for colum n 'name' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
<!-- ~ The MIT License (MIT) ~ ~ Copyright (c) 2017 2587038142@qq.com ~ ~ Permission is hereby granted, free of charge, to any person obtaining a copy ~ of this software and associated documentation files (the "Software"), to deal ~ in the Software without restriction, including without limitation the rights ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ~ copies of the Software, and to permit persons to whom the Software is ~ furnished to do so, subject to the following conditions: ~ ~ The above copyright notice and this permission notice shall be included in ~ all copies or substantial portions of the Software. ~ ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ~ THE SOFTWARE. -->
//deny优先于allow,如果在deny列表中,就算在allow列表中,也会被拒绝。 //如果allow没有配置或者为空,则允许所有访问 //IP黑名单 (存在共同时,deny优先于allow) : 如果满足deny的话提示:Sorry, you are not permitted to view this page. servletRegistrationBean.addInitParameter("deny", "");
<dependencyManagement> <dependencies> <!-- Override Spring Data release train provided by Spring Boot --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-releasetrain</artifactId> <version>Fowler-SR2</version> <scope>import</scope> <type>pom</type> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.5.1.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
项目依赖
起步依赖 spring-boot-starter-xx
Spring Boot提供了很多”开箱即用“的依赖模块,都是以spring-boot-starter-xx作为命名的。举个例子来说明一下这个起步依赖的好处,比如组装台式机和品牌机,自己组装的话需要自己去选择不同的零件,最后还要组装起来,期间有可能会遇到零件不匹配的问题。耗时又消力,而品牌机就好一点,买来就能直接用的,后续想换零件也是可以的。相比较之下,后者带来的效果更好点(这里就不讨论价格问题哈),起步依赖就像这里的品牌机,自动给你封装好了你想要实现的功能的依赖。就比如我们之前要实现web功能,引入了spring-boot-starter-web这个起步依赖。我们来看看spring-boot-starter-web到底依赖了哪些,如下图:
最后
项目启动的三种方式
main方法
使用命令 mvn spring-boot:run在命令行启动该应用,IDEA中该命令在如下位置
运行mvn package进行打包时,会打包成一个可以直接运行的 JAR 文件,使用java -jar命令就可以直接运行