java问题解决
涛涛147
安静的做自己喜欢的事
展开
-
出现 Data truncated for column 'date' at row 1 的错误解决方案
严重: Servlet.service() for servlet [spring-mvc] in context with path [/DBDX] threw exception [Request processing failed; nested exception is com.dbdx.util.DaoException: 数据库操作失败!; nested exception is...原创 2016-11-08 10:36:58 · 167192 阅读 · 6 评论 -
解决list.add() 方法会覆盖前面的已经添加好的参数
Map map = new HashMap(); //mark1List> list = new ArrayList>();for(int i=0;i// map=new HashMap(); //mark2map.clear();map.put("title", i+d);map.put("content", i+e);list.add(map);原创 2016-11-23 10:30:09 · 25121 阅读 · 7 评论 -
错误org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1,actual 0
出现org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1,actual 0 的异常通常是由于接收的某个参数是空值,解决的话可以找到空值try/catch或者看是否代码写的有问题。原创 2016-11-15 14:10:22 · 6975 阅读 · 0 评论 -
java写后台接口时出现乱码的解决方式
response.setCharacterEncoding("UTF-8");request.setCharacterEncoding("UTF-8");response.setHeader("Content-type", "text/html;charset=UTF-8");这三句需要同时编写,试过修改tomcat目录中service.xml文件,但无效。原创 2016-11-02 16:45:29 · 5647 阅读 · 0 评论 -
java获取系统/服务器时间,从String类型时间获取取一部分时间参数
String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());原创 2016-11-10 10:31:40 · 18125 阅读 · 1 评论 -
出现 Column 'sp_id' in field list is ambiguous 的问题解决
一般这个问题出现在多表查询中,这个是由于参数'sp_id' 存在多表中,没有声明是哪一个的参数,解决为:表名 . 参数原创 2016-11-16 14:01:09 · 65620 阅读 · 6 评论 -
win10的mysql服务无法启动的解决方式
如果出现下面的问题:在cmd安装好MySQL后,在启动前先输入mysqld --initialize 进行初始化,然后再启动:完美解决!原创 2016-10-31 13:02:56 · 19840 阅读 · 7 评论 -
出现 check the manual that corresponds to your MySQL server version 的错误解决
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'join,pic fro原创 2016-11-11 14:53:23 · 72904 阅读 · 1 评论 -
MyEclipse "错误: 找不到或无法加载主类 jdk1.7"解决方案
注意:是在环境变量正确的情况下还出错。进入windows中的preferences设置这样已设置就ok了,搞了我一下午才发现。。。。。。。原创 2016-11-09 21:50:03 · 7725 阅读 · 3 评论 -
Access denied for user 'root'@'localhost' (using password: YES) 问题解决
网上大多解决方式为修改其MySQL的密码,但我出现的问题是连新建连接都不可以,查找原因后发现是由于之前的MySQL版本在卸载后,服务依然存在,会自动开启,顶掉现行的MySQL服务导致错误,删掉之前的服务即可。原创 2016-11-09 18:21:50 · 760 阅读 · 0 评论 -
将List集合转化为用符号隔开的String字符串
org.apache.commons.lang3.StringUtils.join(list, ",") Joiner.on(",").join(list);原创 2017-06-20 14:43:43 · 45706 阅读 · 6 评论