安静的转着的博客
安静的转着 · 共 3 篇文章
MySQL自定义中文转拼音函数
今日在网上下载了份省市区对应的数据库,由于要做拼音查询,发现该库里没有拼音字段。于是在网上找到了一遍文章,只能做中文字符串第一个字转拼音。下面只能靠自己了,于是我在此功能的基础上做了很简单的扩展。 参考文章地址: http://www.oicto.com/mysql-zhongwen-pingyin/ 下面说说我的扩展吧,我自定义了两个函数分别功能如下: fristPinyin : 此函数是将一个中文字符串的第一个汉字转成拼音字母 (例如:"中国人"->Z) CREATE FUNCTION `fristPinyin`(P_NAME VARCHAR(255)) RETURNS varchar(…
2013-08-11 10:34 · mysql · 评论(0) · MySQL
TreeMap的一个错误 ...cannot be cast to java.lang.Comparable
今天在页面使用jstl的遍历HashMap [code="java"] ${m.key.stateName } : ${l.states } [/code] 但是每次刷新时顺序都会变化,原来HashMap是遍历时是无序的!如是就想到使用TreeMap [code="java"] Map> map=new TreeMap>(); [/code] BaseState的代码 如下: [code="java"] public class BaseState implements Comparable{ private Integer id; public Integer getId() { retu…
2012-03-28 10:42 · 评论(0) · Java · map
Write operations are not allowed in read-only mode (FlushMode.MANUAL)异常解决的一种方法
[color=red][b]异常:Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.[/b][/color] web.xml内容: [code="xml"] hibernateFilter org.springframework.orm.hibernate3.support.OpenSessionInV…
2011-09-01 15:31 · 评论(0) · Spring · Hibernate · FlushMode.COMMIT/AUTO