13.Java:String和Date、Timestamp之间的转换
12.BigDecimal的使用
1.通过BigDecimal的compareTo方法来进行比较。
返回的结果是int类型,-1表示小于,0是等于,1是大于。
2.对于常用的加,减,乘,除,BigDecimal类提供了相应的成员方法。
public BigDecimal add(BigDecimal value); //加法
public BigDecimal subtract(BigDecimal value); //减法
public BigDecimal multiply(BigDecimal value); //乘法
public BigDecimal divide(BigDecimal value); //除法
11.Spring RestTemplate with parameters:
http://stackoverflow.com/questions/8297215/spring-resttemplate-get-with-parameters
10.数组的声明由几种方式:
1.先声明,再赋值:
String []a = new String[length];
a[0]=?;
.......
2.new完就直接初始化:
String []a = new String[]{?,?...};
3.你甚至不必new:
String []a = {?,?....}
9.MySql查询一周内的数据:
select * from table_name where week(column_time) = week(now())
拓展:
查询一天:
select * from table_name where to_days(column_time) = to_days(now());
或者
select * from table_name where date(column_time) = curdate();
查询一周:
select * from table_name where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);
查询一个月:
select * from table_name where DATE_SUB(CURDATE(), INTERVAL 1 MONTH) <= date(column_time);
8.MySQL简单实现多字段模糊查询:
SELECT * FROM `table_name`
WHERE CONCAT(`title`,`tag`,`description`) LIKE concat(concat('%','content关键字'),'%')
遗留问题:如果这三个字段中有值为NULL,则返回的也是NULL,那么这一条记录可能就会被错过,修改后如下:
SELECT * FROM `table_name` WHERE CONCAT(IFNULL(`title`,''),IFNULL(`tag`,''),IFNULL(`description`,'')) LIKE CONCAT(CONCAT('%','content关键字'),'%')
7.
账号多了:LDAP;
服务器多了:自动化集成;
集成测试:业务测试;
jenkins:打包发布,连接所有;
sonar:代码质量,面对人员流动;
jira:业务
6.Restful:
CRUD:get,post,put,delete
CDN:get,post
5.JAVA中循环删除list中元素的方法:
循环删除list中多个元素的,应该使用迭代器iterator方式。避免会报ConcurrentModificationException错误
Iterator<String> it = list.iterator();
while(it.hasNext()){
String x = it.next();
if(x.equals("del")){
it.remove();
}
}
4.list与数组之间的转换:
1.list转为array;
ArrayList<String> list = new ArrayList<String>();
list.add("dff1");
list.add("dff2");
String[] s=list.toArray(new String[list.size()]);
2.array转为list;
String[] string=new String[]{"s1","s2","s3","s4","s5"};
List<String> li= Arrays.asList(string);