`
ttwang
  • 浏览: 328509 次
  • 性别: Icon_minigender_2
社区版块
存档分类
最新评论

连接数据库

    博客分类:
  • JSP
阅读更多
WEB—INF/lib文件夹下的驱动就放老师给的那三个驱动就行了~~~~
别忘记在链接数据库池时,将tomcat下的server.xml文件改:
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="D:\a_lzy\first" debug="0" reloadable="true">

<Resource
  name="jdbc/myjsp2"
  type="javax.sql.DataSource"
  username="sa"
  password="sa"
  driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
  url="jdbc:sqlserver://localhost:1433;DatabaseName=studentTest"
  maxActive="300"
  maxIdle="100"
  maxWait="5000"
  removeAbandoned="true"
  removeAbandonedTimeout="600"  
  logAbandoned="true"
/>
</Context>

即在host下面加上下面的代码!!!!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics