第一次使用连接池,不太熟悉使用方法,代码如下:
数据源参数配置:
<?xml version="1.0" encoding="UTF-8"?>
type="javax.sql.DataSource"
auth="Container"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:orcl"
username="system"
password="manager"
maxActive="4"
maxIdle="2"
maxWait="6000"/>
建立连接代码:
line21: InitialContext ctx=new InitialContext();
line22: ds=(DataSource)ctx.lookup("java:comp/env/jdbc/oracle");
line23: conn=ds.getConnection();
.
.
.
line40: conn.close();
错误提示:
type Exception report
message An exception occurred processing JSP page /check.jsp at line 22
description The server encountered an internal error that prevented it from fulfilling this request.