java eljstl标签引用和oracle数据源连接池书写代码

xiaoxiao2021-02-27  149

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="/struts-tags" prefix="s"%>   <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

-------------------------------------------------------------------------------------------------------------------------------

 <Resource  name="jdbc/qilimao" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="wbd" password="wbd" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:orcl"/>

Context ct=new InitialContext();     DataSource ds =(DataSource)ct.lookup("java:comp/env/jdbc/qilimao");     con=ds.getConnection();

转载请注明原文地址: https://www.6miu.com/read-13468.html

最新回复(0)