<selectid="selectByUserIdAndStatus"resultType="cn.cb.demo.domain.UserInfo"> select * from user_info where user_id=#{param1} and status=#{param2}
select>
<selectid="selectByUserIdAndStatus"resultType="cn.cb.demo.domain.UserInfo"> select * from user_info where user_id=#{userId} and status=#{status}
select>
<selectid="selectList"resultMap="userResultMap"> select * from user_info where status=1
and user_id in
<foreachcollection="list"item="item"open="("separator=","close=")" > #{item}
foreach>select>
数组传参
这种方式类似List传参,依旧使用 foreach语法。
Mapper方法如下:
ListselectList( String[] userIds);
XML如下:
<selectid="selectList"resultMap="userResultMap"> select * from user_info where status=1
and user_id in
<foreachcollection="array"item="item"open="("separator=","close=")" > #{item}
foreach>select>
首先看看 WeakReference
wiki 上 Weak reference 的一个例子:
public class ReferenceTest {
public static void main(String[] args) throws InterruptedException {
WeakReference r = new Wea
有一个线上环境使用的是c3p0数据库,为外部提供接口服务。最近访问压力增大后台tomcat的日志里面频繁出现
com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResou
https://weblogs.java.net/blog/mriem/archive/2013/11/22/jsf-tip-45-create-composite-component-custom-namespace
When you developed a composite component the namespace you would be seeing would
一、复本集为什么要加入Arbiter这个角色 回答这个问题,要从复本集的存活条件和Aribter服务器的特性两方面来说。 什么是Artiber? An arbiter does
not have a copy of data set and
cannot become a primary. Replica sets may have arbiters to add a
# include <stdio.h>
int main(void)
{
int a[5] = {1, 2, 3, 4, 5};
//a 是数组的名字 5是表示数组元素的个数,并且这五个元素分别用a[0], a[1]...a[4]
int i;
for (i=0; i<5; ++i)
printf("%d\n",