title: Unable to use DataSource in struts 1.3.10
body: <p>Code where I tried to make connection: </p>
  
  <pre><code>DataSource ds = (DataSource)servlet.getServletContext().getAttribute("dbSource");
   System.out.println("ds1 : "+ds);
              try
              {
               Connection conn = (Connection) ds.getConnection();
               target=login(userName, password,request,conn);
              } 
              catch (SQLException e) 
          {
          // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>And <code>&lt;data-source&gt;</code> from Struts-Config.xml.</p>
  
  <pre><code>&lt;data-source type="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" key="dbSource" &gt;
              &lt;set-property property="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
              &lt;set-property property="url" value="jdbc:mysql://192.168.10.57:3306/stocks" /&gt;
              &lt;set-property property="user" value="admin" /&gt;
              &lt;set-property property="password" value="admin" /&gt;
              &lt;set-property property="defaultAutoCommit" value="true" /&gt;
              &lt;set-property property="defaultReadOnly" value="false" /&gt;
              &lt;set-property property="maxActive" value="10" /&gt;
              &lt;set-property property="maxWait" value="5000" /&gt;
  &lt;/data-source&gt;
  </code></pre>