摘要:
这里以MySQL为例: 首先是conf目录下的server.xml GlobalNamingResources中添加: 在content.xml中添加: 在所在应用中的web.xml中添加: MySQL DB Connection Pool java/mysql javax.sql.DataSource Container ... 阅读全文
posted @ 2010-03-26 05:16
macula7
阅读(336)
评论(0)
推荐(0)
摘要:
StandardThreadExecutor类 该类实现了Executor接口,Executor表示可以在Tomcat组件之间共享的线程池,在之前是每个连接器有一个线程池。这样就可以由多个组件之间共享。 executor 对象是嵌入到Service中的,为了跟连接器相关联,必须出现在server.xml的connector元素中,如: workQueue, ... 阅读全文
posted @ 2010-03-25 23:56
macula7
阅读(266)
评论(0)
推荐(0)
摘要:
StandardService类 该类是Service 接口的标准实现,另外还是先lifecycle接口和MBeanRegistration 接口。该类签名如下: public class StandardService implements Lifecycle, Service, MBeanRegistration Service接口是一个或多个连接(Connector)共享一... 阅读全文
posted @ 2010-03-25 23:27
macula7
阅读(231)
评论(0)
推荐(0)
摘要:
NamingResources 类: 该类掌握和管理J2EE企业命名定义的命名资源及其相关的JNDI上下文。该类签名如下: public class NamingResources implements Serializable 域: 1: /** * The property change support for this component. */ ... 阅读全文
posted @ 2010-03-25 22:36
macula7
阅读(113)
评论(0)
推荐(0)
摘要:
StandardServer类: 该类的签名如下: public final class StandardServer implements Lifecycle, Server, MBeanRegistration 该类实现了Lifecycle, Server, MBeanRegistration接口。 Lifecycle接口是Catalina的组件的通用声明周期方法的接口,组件可以选择... 阅读全文
posted @ 2010-03-25 06:26
macula7
阅读(477)
评论(0)
推荐(0)
摘要:
#include #include #include void getRandom(int m,int n){ int select=m; int remain=n; int i=0; srand((int)time(0)); //设置随机数种子,必须 for(i=0;i<n;i++){ srand((int)time(0)); if(rand()%(remain-i)... 阅读全文
posted @ 2010-03-24 03:37
macula7
阅读(115)
评论(0)
推荐(1)
摘要:
输入包括两个整数m和n,并且m<n。输出一个由m个随机数组成的序列表,这些随机数的范围是0到n,并且每个整数最多出现一次,就概率而言,希望得到不需要替换的选择,并且每个选择的可能性都相同。 void getknuth(int m,int n){ for(int i=0;i<n;i++) if(bigrand()%(n-i)<m){ cout<<i<<"\n"; m-... 阅读全文
posted @ 2010-03-24 03:23
macula7
阅读(142)
评论(0)
推荐(0)
摘要:
/** * * Title: 工具类 * * * Description: 用来处理时间日期字符串等 * * * Copyright: (C) 2006.11 常用方法,需要者随便拿去^-^ * * * @author weiking * @version 1.0 */ public class UtilTool { public UtilTool() { super()... 阅读全文
posted @ 2010-03-20 23:15
macula7
阅读(137)
评论(0)
推荐(0)
摘要:
最近效率实在太低,得改改这个毛病。 这学期出不去,在学校也不能虚度。 上下午晚上都该先制定计划,然后高速的搞定。 over!!!! 阅读全文
posted @ 2010-03-20 18:30
macula7
阅读(86)
评论(0)
推荐(0)
摘要:
Java自从引入泛型后,对整个Java编程带来了巨大的变化。现在写类和方法应该都尽量写成类型安全的。 1:构建泛型类 如果要构建一个容器,可以存放各类对象,要怎么办呢?在Java里面是不能构建泛型数组的,常用的解决方案就是用Object数组来代替,而用泛型来对其进行控制。看Vector是如何实现的: protected Object[] elementData; 这就是vector用来存放数据的数... 阅读全文
posted @ 2010-03-20 04:56
macula7
阅读(153)
评论(0)
推荐(0)