关于JNDI配置TOMCAT数据库连接池
来源:百度文库 编辑:神马文学网 时间:2024/06/06 08:45:44
Context initalcontext=new InitialContext();
Context context=(Context)initalcontext.lookup("java:comp/env");
Datasource datasource=(DataSource)context.lookup("jdbc/bzOracleDB");
Connection cn=datasource.getConnection();
2.web应用程序web.xml配置(可以不需要,但在EJB中需要配置)
3.Server.xml配置
driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="100"
maxIdle="30" maxWait="10000"
url="jdbc:oracle:thin:@localhost:1521:skdms"
username="bzzx" password="bzzx" />
4.TOMCAT4-5.0连接池配置
5.TOMCAT 5.5连接池配置
driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="100"
maxIdle="30" maxWait="10000"
url="jdbc:oracle:thin:@localhost:1521:skdms"
username="bzzx" password="bzzx" />