title: How to use JRDataSource for jasper reports
body: <p>Previously I am sending the connection object to the <em><code>fillReport()</code></em> of <em><code>JasperFillManager</code></em> class. It is working fine and it is generating the data also. The below is the code I am using for database connection.</p>
  
  <pre><code>Connection conn = null; 
  Class.forName("com.mysql.jdbc.Driver"); 
  conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/dbname", "username", "password");
  </code></pre>
  
  <p>But now I don't want to pass the connection object to the <em><code>fillReport()</code></em> instead I want to pass the JRDataSource. How can I achieve this? How to configure this <em><code>JRDataSource</code></em> in my spring configuration file with mysql database information? Can any one please tell me.</p>
  
  <p>I am using <code>iReport 4.5.0</code> and <code>Spring 3.0.5 RELEASE</code>. If you want anymore information I will give you.</p>