1):

  在tomcat的配置路径下的context.xml中添加如下代码:

  

<Resource name="jdbc/cmis"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="50"
maxWait="15000"
username="root"
password=""
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/mdym" />

2):

  在要引用JNDI的工程中的WEB-INF的web.xml中添加如下代码:

<resource-ref>
<res-ref-name>jdbc/cmis</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

3):

  在spring的hibernate的配置文件中添加如下代码:

<bean >
<value>java:comp/env/jdbc/cmis</value>
</property>
</bean>

4):

commons-pool.jar

sqljdbc4.jar

两个.jar文件必须放在tomcat配置路径下的lib文件夹里

  

相关文章:

  • 2021-11-27
  • 2021-07-31
  • 2022-12-23
  • 2021-04-07
  • 2022-12-23
  • 2022-02-09
  • 2021-11-01
  • 2021-04-21
猜你喜欢
  • 2021-05-20
  • 2022-12-23
  • 2021-10-13
  • 2021-05-20
  • 2022-01-08
  • 2022-12-23
相关资源
相似解决方案