jjklm

struts中数据源的配置

 <data-sources>
  <data-source key="dataSource">
   <set-property property="driverClass" value="oracle.jdbc.driver.OracleDriver" />
   <set-property property="url" value="jdbc:oracle:thin:@127.0.0.1:1521:oracle9i" />
   <set-property property="maxCount" value="5"/>
   <set-property property="minCount" value="2"/>
  <set-property property="user" value="scott"/>
  <set-property property="password" value="tiger"/>
  <set-property property="autoCommit" value="true"/>
  </data-source>
 </data-sources>

<data-sources>
    <data-source key="A" type="org.apache.commons.dbcp.BasicDataSource">
      <set-property property="driverClassName"
          value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
      <set-property property="url"
          value="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=mystruts;SelectMethod=cursor" />
      <set-property property="username" value="sa" />
      <set-property property="password" value="yourpwd" />
      <set-property property="maxActive" value="10" />
      <set-property property="maxWait" value="5000" />
      <set-property property="defaultAutoCommit" value="false" />
      <set-property property="defaultReadOnly" value="false" />
    </data-source>
  </data-sources>

posted on 2006-09-13 17:09 天涯孤客 阅读(80) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: