sqlÓï¾äÈçºÎ·Åµ½xml spring2.5
¸÷λ´óÏÀ£¬ÔÚÏÂÇë½ÌÒ»¸öÎÊÌ⣬Îʵõͼ¶Á˲»Òª¼ûЦ£¬ÎÒÓõÄÊÇspring2.5£¬À¨ºÅ£¬²»Ê죬ҵÎñ²ãµÄʵÏÖÒ»°ãÊÇÕâÑùдµÄ
public List <Object> checkLogin(User user)
{
String sql=" select * from `user` where loginname=? and password=? and `isdeleted`=0 ";
Object[] object={ user.getLoginname(),user.getPassword() };
return loginDao.selectAll(sql, object, EUser.class);
}
¶¼ÊÇÕâÖÖ¸ñʽ£¬ÎÒÏÖÔÚÏë°ÑsqlÓï¾äÈ«²¿·Åµ½xmlÀïÃæÈ¥£¨²Ù×÷Êý¾Ý¿âÓõÄÊÇJDBC²»ÊÇhibernate£©£¬¸ÃÓøöʲô˼·£¬»òÕß˵Óøöʲô¼¼Êõ£¬¹Ø¼ü¾ÍÊÇÄǸöռλ·û¸ÃÔõô´¦Àí£¬ÎÒÏëÈÃsqlºÍjava·Ö¿ª£¬µ«ÊÇÔõô¸øÕ¼Î»·û¸³Öµ£¬µ¥´¿ÊÇspringÄܲ»ÄÜÓÐÕâ¸ö¹¦ÄÜ£¬Íû¸ßÊÖ²»Áߴͽ̣¡£¡£¡£¡
ibatis+spring
Ϊʲô²»ÓÃhibernateÄØ£¿
ÄãÄǸöÓÃ×¢Èë²»¾ÍµÃÁË£¬ÀàÖÐдһ¸öÊôÐÔ£¬ÔÚÅäÖÃÎļþ×¢ÈëÒ»ÏÂ
ÕýºÃÎÒÏÖÔÚ½Ó´¥µÄÕâ¸öÏîÄ¿ÊÇÍêÈ«ÓÃspring ·ÃÎÊjdbcTemplate×öµÄ£¬sqlÊÇдÔÚspringÀïµÄ£¬Õâ¸öÄãÒªÏȶ¨ÒåÒ»¸öLoginGetSql.java ´¦ÀíÇëÇóÒ²ÊÇÓÃspringµÄ MVCʵÏÖµÄ
±ÈÈçpublic class LoginGetSql{
private String loginsql;
//Éú³ÉgeterºÍsetter
}
springÅäÖÃÎļþÖÐ
<bean id="loginMappingManual"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref bean="RequestHandlerInterceptor" />
</list>
</prop
Ïà¹ØÎÊ´ð£º
txt ºÍXML ¸ñʽÏàÓ¦
²»½èÖúDataSet
µ¼Èë¶ÁÈ¡TXTÎļþ
È»ºóÖ±½ÓдÈëXML(ͬһÎļþ,²»Í¬Êý¾Ý,µÝÔöÔÊý¾ÝûÓб»¸²¸ÇÇé¿öÏÂÔö¼ÓÊý¾Ý.)
½Ì¸öÒªµã»ò×îºÃÊÇÓиö´úÂëÌáʾµÄ
¹ý·ºÃºº °ï¸öæÈö^^
²»»á£¬°ïÂ¥Ö÷ ......
Êý¾Ý¿â±íÖÐÓÐÒ»ÁУ¨TranXml£©ÀàÐÍÊÇxml£¬´æ´¢µÄÊÇÀàËÆ
<fathernode>
<a>aaa
</a>
<b>bbb
</b>
</fathernode>
µÄÐÅÏ¢£¬²¢ÇÒͨ¹ý²éѯ·½· ......
<table style="width: 1000px"><tr>
<td style="height: 38px; width: 35px;">
ÐÕÃû</td>
......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽÎļþ
<folder state="unchecked" label="È«²¿">
¡¡¡¡<folder state="unchecked" isBra ......