ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使Domino支持连接池技术

使Domino支持连接池技术

原创 Linux操作系统 作者:genusBIT 时间:2008-07-17 16:50:59 0 删除 编辑
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();

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14751907/viewspace-402894/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-07-04

  • 博文量
    233
  • 访问量
    483849