12 2016 档案
摘要:一. 问题 数据库编码:utf8 表编码:utf8 jdbc url: 数据库和数据库表都已经使用了utf8编码,但是插入中文数据时仍然乱码。 二. 原因 在jdbc中连接mysql时,jdbc url参数中有一个属性characterEncoding控制字符串编码,该值默认为:autodetect
阅读全文
摘要:在使用HTTPURLConnection发送POST数据时,通常使用如下方式: 【参考】 http://blog.csdn.net/chenlei1889/article/details/6363356
阅读全文
摘要:在执行maven打包时不需要执行测试用例,使用如下2种方式实现:-DskipTests=true : 不执行测试用例,但编译测试用例类生成相应的class文件至target/test-classes下。-Dmaven.test.skip=true: 不执行测试用例,也不编译测试用例类 当然,还可以使
阅读全文
摘要:在maven多模块项目中,对子模块中的测试文件不需要打包到目标项目中,以免产生影响。实现方法: 1. 将测试资源放在java/test/resources 目录下,mvn package默认不会将test目录下的资源文件打包到最终的jar包中。2. 打包时对相关资源进行过滤:
阅读全文
摘要:一、全局设置 1.Window > Preferences 2.General > Workspace > Text file encoding. 3.选择 Other 4.手工输入UTF-8 二、配置java应用程序的控制台输出 1.Run -> Run configurations... 2.在
阅读全文
摘要:1. eclipse安装主题插件:http://www.eclipsecolorthemes.org/ 。 2. eclipse terminal插件:在eclipse中集成终端,使用非常方便,不用单独打开cmd控制台。可以直接在eclipse应用市场搜索安装。 3. findbugs插件:http
阅读全文
摘要:配置文件以application.yml为例说明: Spring Boot默认的日志组件为Logback。 一. 日志配置参数: 二. 更改Spring Boot日志组件为Log4j(注:Spring Boot仅仅支持Log4j 2.x版本): 三. 关于Spring Boot日志文件路径的疑惑?同
阅读全文
摘要:Spring Boot profile用于分离不同环境的参数配置,通过spring.profile.active参数设置使用指定的profile。 在Spring Boot中应用程序配置可以使用2种格式:application.properties 或者 application.yml。 以".ym
阅读全文
摘要:一. What: Spring Boot是什么?以1.4.3.RELEASE为例,官方介绍为:http://docs.spring.io/spring-boot/docs/1.4.3.RELEASE/reference/html/getting-started-introducing-spring-
阅读全文
摘要:SQLite官网: https://www.sqlite.org/index.html 1. 下载请到https://www.sqlite.org/download.html下载相应平台的sqlite包:windows: sqlite-tools-win32-x86-xxxxx.zip linux:
阅读全文
摘要:解决eclipse spring配置报错:cvc-elt.1: Cannot find the declaration of element 'beans'.Referenced file contains errors (http://www.springframework.org/schema/
阅读全文
摘要:在maven项目中,对于那些在maven仓库中不存在的第三方jar,依赖解决通常有如下解决方法: 方法1:直接将jar包拷贝到项目指定目录下,然后在pom文件中指定依赖类型为system,如: 1 <dependencies> 2 <dependency> 3 <groupId>xxx</group
阅读全文