1):
在tomcat的配置路径下的context.xml中添加如下代码:
auth="Container"
type="javax.sql.DataSource"
password=""
username="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/mdym"
maxActive="100"
maxIdle="2"
maxWait="5000" />
2):
在要引用JNDI的工程中的WEB-INF的web.xml中添加如下代码:
mysql DBConnection Pool
jdbc/cmis
javax.sql.DataSource
Container
3):
在spring的hibernate的配置文件中添加如下代码:
class="org.springframework.jndi.JndiObjectFactoryBean" >
java:comp/env/jdbc/cmis
4):
commons-pool.jar
sqljdbc4.jar
两个.jar文件必须放在tomcat配置路径下的lib文件夹里