????????Tomcat6.0???????????????
???????????? ???????[ 2013/8/5 10:42:44 ] ????????
????Tomcat?????????????????????????????????ò??????Tomcat?????????????????????Tomcat6.0???????á?
????1.???????????μ?META-INF(???????WEB-INF??????????????ū????)??????????context.xml???????????????
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource> //???????
<Resource
name="myoracle" //????????????????????????????е??á?
auth="Container" //
type="javax.sql.DataSource" //???????
driverClassName="oracle.jdbc.OracleDriver" //??????????????????????????????ο??????
url="jdbc:oracle:thin:@localhost:1521:ICSS" //???????????????????????
username="jsp" //??????????????
password="jsp" //??????????????
maxActive="200" //???????200??????????????
maxIdle="10" //?????????????????10???????????????
maxWait="5000"/> //????????????5000????????????????????????????????
</Context>
????2.??????????myeclipse?????tomcat??????????tomcat????confCatalinalocalhost???host-manager.xml??manager.xml??
????3.?????servlet?????????????÷?????
?????????????????
import javax.sql.DataSource;
import javax.naming.InitialContext;
import java.sql.Connection;
InitialContext initCtx = new InitialContext(); //
//?????” java:comp/env”???????”myoracle”????context.xml???????name??
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/myoracle");
Connection conn = ds.getConnection(); //????????
?????????
????1.Sql server ??context.xml?????
<Resource
name="????"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="5000"
username="?????"
password="????"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=???????"
/>
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11