title: Tomcat6 MySql JDBC Datasource configuration
body: <p>I've always used Spring's dependency injection to get datasource objects and use them in my DAOs, but now, I have to write an app without that.</p>
  
  <p>With Spring I can write something like this:</p>
  
  <pre><code>&lt;bean id="dataSource"
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
      &lt;property name="url" value="jdbc:mysql://127.0.0.1/app?characterEncoding=UTF-8" /&gt;
      &lt;property name="username" value="u" /&gt;
      &lt;property name="password" value="p" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But how can I use datasource in my DAOs without Spring or anything? I'm using servlets and JSPs only. Performance is very important factor. </p>