|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
有了这样一个呼声:让java代替C语言成为基本语言。这些足以说明java简单易学的这个优点。其次,java的功能强大,前面我也提到了,EJB3.0的推出使java成为了大型项目的首选。mysql|server|xml$CATALINA_HOME/conf/server.xml
<Contextpath="/DBTest"docBase="DBTest"
debug="5"reloadable="true"crossContext="true">
<LoggerclassName="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log."suffix=".txt"
timestamp="true"/>
<Resourcename="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParamsname="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!--MaximumnumberofdBconnectionsinpool.Makesureyou
configureyourmysqldmax_connectionslargeenoughtohandle
allofyourdbconnections.Setto0fornolimit.
-->
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<!--MaximumnumberofidledBconnectionstoretaininpool.
Setto-1fornolimit.SeealsotheDBCPdocumentationonthis
andtheminEvictableIdleTimeMillisconfigurationparameter.
-->
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<!--MaximumtimetowaitforadBconnectiontobecomeavailable
inms,inthisexample10seconds.AnExceptionisthrownif
thistimeoutisexceeded.Setto-1towaitindefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!--MySQLdBusernameandpasswordfordBconnections-->
<parameter>
<name>username</name>
<value>javauser</value>
</parameter>
<parameter>
<name>password</name>
<value>javadude</value>
</parameter>
<!--Classnamefortheoldmm.mysqlJDBCdriver-uncommentthisentryandcommentnext
ifyouwanttousethisdriver-werecommendusingConnector/Jthough
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
-->
<!--ClassnamefortheofficialMySQLConnector/Jdriver-->
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<!--TheJDBCconnectionurlforconnectingtoyourMySQLdB.
TheautoReconnect=trueargumenttotheurlmakessurethatthe
mm.mysqlJDBCDriverwillautomaticallyreconnectifmysqldclosedthe
connection.mysqldbydefaultclosesidleconnectionsafter8hours.
-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>该使用的设置WEB-INF/web.xml<web-appxmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<web-app>
<description>MySQLTestApp</description>
<resource-ref>
<description>DBConnection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
认真的记,感觉很紧张根本就没有时间和能力,来对技术知识点进行思考。这样课下就只能对知识进行简单的理解,其实简单的理解就是记忆课堂上讲的知识点, |
|