随笔分类 -  J2EE

上一页 1 2 3

Ibatis的resultMap与resultClass
摘要:1、resultMap属于直接映射,可以把结果集中的数据库字段与实体类中的属性一一对应,这样通过select语句得到的结果就会准确的对上号 2、resultclass属于隐身映射,虽然你指定resultclass=“”,具体某一个类,但是select语句得到的结果是一条实力记录,但如果数据库字段与类的属性名字不一致,这个时候就会出现映射错误,有一种方式可以解决就是在写select语句时,给每个字段用as运算符取名字与属性一样:例如:select realname as name...其中realname是字段列名,name是属性字段名3、resultmap比resultclass性能要高。尽量 阅读全文

posted @ 2010-12-17 15:22 archie2010 阅读(1090) 评论(0) 推荐(0)

java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
摘要:--- The error occurred in sqlMap/adInfo.xml. --- The error occurred while applying a parameter map. --- Check the insertAdInfo-InlineParameterMap. --- Check the parameter mapping for the 'clicks' property. --- Cause: java.sql.SQLException: Parameter index out of range (1 number of parameters, whic 阅读全文

posted @ 2010-12-17 14:27 archie2010 阅读(7565) 评论(0) 推荐(0)

springMVC入门配置
摘要:DispatcherServletweb.xml[代码]springapp-servlet.xml[代码]Product.java[代码]ProductManager.java[代码]代码InventoryController.java[代码] 阅读全文

posted @ 2010-12-13 18:33 archie2010 阅读(11085) 评论(0) 推荐(1)

ibatis模糊查询
摘要:Person.xml[代码]PersonDao.java[代码] 阅读全文

posted @ 2010-12-10 08:14 archie2010 阅读(6281) 评论(0) 推荐(0)

Error setting properties of-ibatis-数据库不能为NULL
摘要:com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in sqlMap/google_campaigns.xml. --- The error occurred while applying a result map. --- Check the googleCampaigns.googleCampaignsResult. --- The error happened while setting a property on the result object. --- Cause: com.ib 阅读全文

posted @ 2010-12-09 09:19 archie2010 阅读(790) 评论(0) 推荐(0)

Struts2自定义拦截器
摘要:LoginInterceptor.javaCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.tq365.util;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpSession;import org.apache.struts2.ServletActionContext;import com.opensymphony.x 阅读全文

posted @ 2010-12-08 08:16 archie2010 阅读(635) 评论(0) 推荐(0)

ibatis缓存配置
摘要:sql配文件中的缓存配置Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><cacheModel id="user-cache" type="LRU"><flushInterval hours="24"/><flushOnExecute statement="insertUser"/><flushOnExecute stat 阅读全文

posted @ 2010-12-06 17:34 archie2010 阅读(834) 评论(0) 推荐(0)

绝对路径${pageContext.request.contextPath}
摘要:------------------------用urlrewrite改写url------------------------------登录后第一次点击正确,鼠标放在链接上,出现正确url--------------http://localhost:8080/ibatisORM/listuser/2但点击之后,链接会变成http://localhost:8080/ibatisORM/listuser/listuser/2加上绝对路径${pageContext.request.contextPath}----a href="${pageContext.request.contextPath 阅读全文

posted @ 2010-12-02 11:07 archie2010 阅读(2489) 评论(0) 推荐(0)

上一页 1 2 3