title: Struts- Best way to connect to Mysql in struts 2?
body: <p>Unable to determine what is the best way to connect to mysql database in struts..</p>
  
  <ol>
  <li>We can always use <code>DriverManger</code> and <code>Class.forName()</code> to connect.</li>
  <li><p><code>DataSource</code> interface - but this has problems I am getting compliation error for</p>
  
  <p>DataSource dataSource = (DataSource)context.getAttribute(Globals.DATA_SOURCE_KEY);
  or when <code>Action.Data_SOURCE_KEY</code> is used. when searched I found that these variables are depricated.</p></li>
  </ol>
  
  <p>How can I use connection pooling in struts?What is best place to place url,username,pass for database?DO i still have to use datasource configuration in same way in struts-config? Then why was this facility depricated?  </p>
  
  <p>Too many queastions but I cannot find a definite source to learn struts.
  Struts doc can be but then revisions and backword compatibility are the issues which a learner cannot get easily... Pls suggest a good source to learn struts2.</p>