domino支持连接池,不过需要第三方软件支持,我的原帖在lotus爱好者论坛上发表了。不过好像没有什么反应,因此在CU上再发一回,就一回,下不为例。
Domino支持连接池吗?不支持,Domino本身并不支持连接池技术。那么怎么能让它支持连接池那?
这个问题终于有了答案。可以使用第三方的jndi server,比如jboss的jnpserver,在jnpserver中注册数据源,然后在java代理中取数据源即可。
unpooled = DataSources.unpooledDataSource("jdbc:oracle:thin:@192.168.0.1:1521:devuser", "admin", "password");
pooled = DataSources.pooledDataSource(unpooled);
Properties env = new Properties();
env.load(new FileInputStream("jndi.properties"));
env.list(System.out);
System.out.println("starting jnpserver...");
jnpserver = new Main();
jnpserver.start();
NamingServer name = (NamingServer)jnpserver.getServer();
//Bind DataSource
InitialContext ctx = new InitialContext(env);
System.out.println("Binding PooledDataSource.");
ctx.bind("Naming", pooled);
在代理中的代码:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("Naming");
conn = ds.getConnection();
Domino支持连接池吗?不支持,Domino本身并不支持连接池技术。那么怎么能让它支持连接池那?
这个问题终于有了答案。可以使用第三方的jndi server,比如jboss的jnpserver,在jnpserver中注册数据源,然后在java代理中取数据源即可。
unpooled = DataSources.unpooledDataSource("jdbc:oracle:thin:@192.168.0.1:1521:devuser", "admin", "password");
pooled = DataSources.pooledDataSource(unpooled);
Properties env = new Properties();
env.load(new FileInputStream("jndi.properties"));
env.list(System.out);
System.out.println("starting jnpserver...");
jnpserver = new Main();
jnpserver.start();
NamingServer name = (NamingServer)jnpserver.getServer();
//Bind DataSource
InitialContext ctx = new InitialContext(env);
System.out.println("Binding PooledDataSource.");
ctx.bind("Naming", pooled);
在代理中的代码:
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("Naming");
conn = ds.getConnection();
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14751907/viewspace-402894/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14751907/viewspace-402894/