ITeye博客

安静的转着的博客

安静的转着 · 共 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)

TreeMap的一个错误 ...cannot be cast to java.lang.Comparable

今天在页面使用jstl的<c:froEach>遍历HashMap <c:forEach items="${ydMap }" var="m"> <div class="mbody"> <div class="title cv">${m.key.stateName }<a href="${pageContext.request.contextPath }/pl/deleteBlackStatesByState.do?id=${m.key.id }&flag=0"><img src="${pageContext.request.contextPath }/images/jh.png" /></a>…

2012-03-28 10:42 · 评论(0)

Write operations are not allowed in read-only mode (FlushMode.MANUAL)异常解决的一种方法

异常: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. web.xml内容: <filter> <filter-name>hibernateFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.Ope…

2011-09-01 15:31 · 评论(0)