Sun Java System Application Server Platform Edition 连接池配置方法
2006-06-23 07:59
513 查看
以下设置在Sun Java System Application Server Platform Edition 8.1_02 (build b06-fcs)上设置成功
(配置Oracle9连接池)
1.1.名称:Oracle9Pool
1.2.资源类型:javax.sql.DataSource
1.3.数据库供应商:oracle
2.1.数据库源类名:oracle.jdbc.pool.OracleDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留三项:URL: jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:orcl
Password:yourpass
User: yourname
以下可以继续配置数据源, 并可用下列代码测试.
<%@page contentType="text/html"%>
<%@page pageEncoding="GBK" import="java.sql.*,javax.sql.*,javax.naming.*"%>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
<%
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("jdbc/Oracle9Pool");
//注意上面一行: 与tomcat不同, 不是"java:/comp/env/jdbc/Oracle9Pool"
Connection conn = ds.getConnection();
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from xxzxuid");
while (rs.next()){
out.print(rs.getString(3));
}
rs.close();
st.close();
conn.close();
%>
</body>
</html>
==============================================================================================
以下设置在Sun Java System Application Server Platform Edition 8.1_02 (build b06-fcs)上设置成功
(配置mySQL连接池)
1.1.名称:mysqlPool
1.2.资源类型:javax.sql.ConnectionPoolDataSource
1.3.数据库供应商:mysql
2.1.数据库源类名:com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留五项:databasename: yourDB (对应mysql中的schemata,默认的数据库)
serverName: localhost
port: 3306
Password: yourpass
User: yourname
==============================================================================================
以下设置在Sun Java System Application Server Platform Edition 8.1_02 (build b06-fcs)上设置成功
(配置ms SQL Server连接池)
1.1.名称:mssqlPool
1.2.资源类型:javax.sql.DataSource
1.3.数据库供应商:mssql
2.1.数据库源类名:com.microsoft.jdbcx.sqlserver.SQLServerDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留五项:databasename: YourDB (对应ms sql中的数据库)
serverName: localhost
port: 1433
Password: yourpass
User: yourname
(配置Oracle9连接池)
1.1.名称:Oracle9Pool
1.2.资源类型:javax.sql.DataSource
1.3.数据库供应商:oracle
2.1.数据库源类名:oracle.jdbc.pool.OracleDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留三项:URL: jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:orcl
Password:yourpass
User: yourname
以下可以继续配置数据源, 并可用下列代码测试.
<%@page contentType="text/html"%>
<%@page pageEncoding="GBK" import="java.sql.*,javax.sql.*,javax.naming.*"%>
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
<%
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("jdbc/Oracle9Pool");
//注意上面一行: 与tomcat不同, 不是"java:/comp/env/jdbc/Oracle9Pool"
Connection conn = ds.getConnection();
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from xxzxuid");
while (rs.next()){
out.print(rs.getString(3));
}
rs.close();
st.close();
conn.close();
%>
</body>
</html>
==============================================================================================
以下设置在Sun Java System Application Server Platform Edition 8.1_02 (build b06-fcs)上设置成功
(配置mySQL连接池)
1.1.名称:mysqlPool
1.2.资源类型:javax.sql.ConnectionPoolDataSource
1.3.数据库供应商:mysql
2.1.数据库源类名:com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留五项:databasename: yourDB (对应mysql中的schemata,默认的数据库)
serverName: localhost
port: 3306
Password: yourpass
User: yourname
==============================================================================================
以下设置在Sun Java System Application Server Platform Edition 8.1_02 (build b06-fcs)上设置成功
(配置ms SQL Server连接池)
1.1.名称:mssqlPool
1.2.资源类型:javax.sql.DataSource
1.3.数据库供应商:mssql
2.1.数据库源类名:com.microsoft.jdbcx.sqlserver.SQLServerDataSource
3.1.“池设置”、“连接验证”、“事务隔离”使用默认值
3.2.“属性”保留五项:databasename: YourDB (对应ms sql中的数据库)
serverName: localhost
port: 1433
Password: yourpass
User: yourname
相关文章推荐
- Sun Java System Application Server Platform Edition 8.2 + 远程服务器管理
- Sun Java System Appliation Server中连接池的配置
- 新品发布:Sun Java System Directory Server Enterprise Edition 6.1(eNew 第二十八期/2007.09)
- java中读取配置文件的方法fileSystemXmlapplicationContext与classPathXmlApplicationContext
- SUN ONE APPSERVER 7 连接池和数据源的配置方法和调用
- EJB3会话Bean的开发——NetBeans和SunJavaSystemApplicationServer
- Sun Java System Directory Server Enterprise Edition 6.0
- EJB3 Application Client——NetBeans和SunJavaSystemApplicationServer
- 一个Sun Java System Application Server访问MBean信息的示例
- iis出现 Server Application Error 错误解决方法(xp iis5.1 配置asp项目出现500错)
- sun java system server console学习 (一)
- Sun Java(TM) System Directory Proxy Server 5.2 2005Q1 管理指南
- Sun java studio creator+Sun java application server 8.2+ Jbuilder2005+Jboss4.0.4+Ms sql server2000开发部署要领
- 将NetBeans Profiler集成到Sun Java System Web Server 7.0
- Spring ClassPathXmlApplicationContext和FileSystemXmlApplicationContext读取配置文件的方法
- sun java system server console学习(二)
- 将NetBeans Profiler集成到Sun Java System Web Server 7.0
- 在Sun Java System Web Server上使用Quercus运行PHP
- 将NetBeans Profiler集成到Sun Java System Web Server 7.0
- java开发连接池配置方法总结