网站首页 新闻首页 网页设计图形动画软件编程网站开发办公软件操作系统数据库网络技术认证考试范文资料黑客攻防 书籍教程 进入论坛

Resin2.1.12的数据库连接池配置

http://www.diybl.com/ 2007-2-6  网络 点击:  [ 评论 ]
文章搜索:    【点击打包该文章】


(摘自JAVA中文站)

Resin的确是比较狠的应用服务器,运行速度快,配置又简单!这里介绍一下Resin2.1.12的数据库连接池配置方法。 在%ResinHome%/conf/resin.conf中找到 <!-- - Sample database pool configuration - The JDBC name is java:comp/env/jdbc/test --> 在其下加入相应的信息可以连接到不同的数据库。 Mysql: <resource-ref> <res-ref-name>jdbc/blog</res-ref-name> <res-type>javax.sql.DataSource</res-type> <init-param driver-name="com.caucho.jdbc.mysql.Driver"/> <init-param url="jdbc:mysql_caucho://localhost:3306/blog"/> <init-param user="root"/> <init-param password="****"/> <init-param max-connections="20"/> <init-param max-idle-time="30"/> </resource-ref> 将相应的驱动放到%Resin/lib/%下。 MS-Sql: <resource-ref> <res-ref-name>jdbc/blog</res-ref-name> <res-type>javax.sql.DataSource</res-type> <init-param driver-name="com.microsoft.jdbc.sqlserver.SQLServerDriver"/> <init-param url="jdbc:microsoft:sqlserver://localhost:1433;databaseName=blog"/> <init-param user="sa"/> <init-param password="****"/> <init-param max-connections="20"/> <init-param max-idle-time="30"/> </resource-ref> 首先要下载安装sqlserver-jdbc-驱动,然后将其lib下的三个jar文件放到%Resin/lib/%下。  

如果图片或页面不能正常显示请点击这里 站内搜索:   

文章评论

请您留言