title: Tomcat Connection Pooling - java.lang.UnsupportedOperationException: Not supported by BasicDataSource
body: <p>I have tried C3po library for connection pooling but I am gettting errors such as <code>abstractMethodError()</code> for my code I then decided to go with the tomcat pooling thing. Now I am getting an </p>
  
  <pre><code>    java.lang.UnsupportedOperationException: Not supported by BasicDataSource
      at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1062)
      at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)
      at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
      at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:194)
      at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:522)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
      at classes.session.SessionCreate.buildSessionFactory1(SessionCreate.java:24)
      at classes.session.SessionCreate.&lt;clinit&gt;(SessionCreate.java:9)
      at classes.verifydata.CheckUniqueUserPass.uniqueUserPass(CheckUniqueUserPass.java:16)
      at org.apache.jsp.DataGen.CheckUserPassAvailable_jsp._jspService(CheckUserPassAvailable_jsp.java:70)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
      10:56:19,762  INFO [http-bio-8081-exec-5] StatisticalLoggingSessionEventListener:275 - Session Metrics {
          42607 nanoseconds spent acquiring 1 JDBC connections;
          0 nanoseconds spent releasing 0 JDBC connections;
          0 nanoseconds spent preparing 0 JDBC statements;
          0 nanoseconds spent executing 0 JDBC statements;
          0 nanoseconds spent executing 0 JDBC batches;
          0 nanoseconds spent performing 0 L2C puts;
          0 nanoseconds spent performing 0 L2C hits;
          0 nanoseconds spent performing 0 L2C misses;
          0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
          0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
      }
      Jan 06, 2015 10:56:19 AM org.apache.catalina.core.StandardWrapperValve invoke
  </code></pre>
  
  <p>I have the Hibernate configuration file as such </p>
  
  <pre><code> &lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
  "-//Hibernate/Hibernate Configuration DTD//EN"
  "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
          &lt;property name="connection.driver_class"&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/property&gt;
          &lt;property name="hibernate.connection.datasource"&gt;java:comp/env/jdbc/secure_pass&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;connectionurl&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;&lt;/property&gt;
  
          &lt;property name="hibernate.hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;property name="net.sf.jasperreports.hql.query.run.type"&gt;list&lt;/property&gt;
          &lt;property name="net.sf.jasperreports.jdbc.fetch.size"&gt;50&lt;/property&gt;
          &lt;property name="net.sf.jasperreports.hql.clear.cache"&gt;true&lt;/property&gt;
          &lt;property name="net.sf.jasperreports.hql.query.list.page.size"&gt;50&lt;/property&gt;
  
          ......
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I also have the context-xml file as such :</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; 
      &lt;Context antiJARLocking="true" path="/DVDStore"&gt;
  
    &lt;Resource 
    auth="Container"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
    maxActive="30" maxIdle="10" 
    maxWait="10000" 
    name="jdbc/secure_pass" 
    password=""
    type="javax.sql.DataSource" 
    url="_DEV;" 
    username="r"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Do not worry about values here...  Now I am getting the above exception: Please help. I have done All that which is required as per this <a href="http://wiki.apache.org/tomcat/TomcatHibernate" rel="nofollow">link</a></p>