1
来源:互联网 发布:手机浏览器查看源码 编辑:程序博客网 时间:2024/06/15 09:31
1在 今天弄hiberanate 实例化对象之后,数据库的 tingyint 所以生成的实例的是short 类型 然后我改成 int 结果一直报错说是not column 错 ,并且是个String 字段 重新映射一遍就好了 ,很奇怪
2在本地测试全程无错,当上传服务器端,插入数据时说 trastion not sucess begin ,然后 在查询时也报错 找不到 texstfly.errdc 表,这其实是本地的数据库才叫testfly,重新连接 服务器端的jdbc ,重新用hibernate 实例化 映射对象一遍 ,所有问题全部解决。
有时候,一个bug解决不了,先放放,再回头可能就解决了。 神清气爽啊是。。。。
3.关于 struts 2和hibernate 的乱码问题
struts2 方面 <constant name="struts.i18n.encoding" value="UTF-8" />
x写了个 过滤器 public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
request.setCharacterEncoding("utf-8");
// 传递控制到下一个过滤器
chain.doFilter(request, response);
}
web.xml 的配置
<filter>
<filter-name>SetCharacterEncoding</filter-name>
<filter-class>filter.SetCharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
hibernate 方面url 设置 jdbc:mysql://localhost:3306/testfly?useUnicode=true&characterEncoding=utf8
mysql 的delete 语句多表删除 "DELETE alldatas a ,errorqianfly e ,errorzhifly e1"
+" FROM alldatas a ,errorqianfly e , errorzhifly e1"
+" where a.account = e.account"
+" and e.account=e1.account"
+" and a.proid=:proid and a.account=:account";
- 1
- 1
- 1
- 1
- 1
- 1
- 1》
- 1
- 1
- 1
- 1
- (1)
- 1
- 1
- 1
- 1
- 1
- 1
- 二值图像的距离变换研究
- ubuntu下usb抓包方法步骤--usbmon
- 计算机网络概述
- JavaScript系列文章:详解正则表达式之三
- struts2之OGNL和struts2标签库
- 1
- ViewPager实现循环滚动
- 商派BBC系统——商家管理管理中心的菜单配置
- 有关enumerate、block遍历与NSEnumerator枚举器在NSString、NSArray、NSDictionary中的使用总结
- 解锁bios学习总结
- org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0
- spring cloud eureka 集群 服务集群 测试
- 不考虑重复字符的字符串组合
- Android Manifest merger failed with multiple errors解决思路