title: Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/OracleShardingKeyBuilder
body: <p>I'm trying to get DB connection from DB pool. Following is my source code and it returns " java.lang.NoClassDefFoundError: oracle/jdbc/OracleShardingKeyBuilder" at runtime. But I have imported ucp.jar file.</p>
  
  <p>Please help me to sort out the issue.</p>
  
  <pre><code>private static PoolDataSource pds = null;
  private static Connection conn = null;
  
  public static synchronized Connection getConnectionFromPool() throws Exception {
      String print;
      String nl = "\r\n";
      try {
          pds = PoolDataSourceFactory.getPoolDataSource();
          System.out.println(CommonInfo.url);
          System.out.println(CommonInfo.uName);
          pds.setURL(CommonInfo.url);
          pds.setUser(CommonInfo.uName);
          pds.setPassword(CommonInfo.uPassword);
          pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
  
          //Setting pool properties
          pds.setInitialPoolSize(5);
          pds.setMinPoolSize(5);
          pds.setMaxPoolSize(20);
  
          int usedConnctionCount = pds.getBorrowedConnectionsCount();
          int AvailableConnctionCount = pds.getAvailableConnectionsCount();
  
          int totalCount = usedConnctionCount + AvailableConnctionCount;
  
  
          if (AvailableConnctionCount != 0) {
  
              conn = pds.getConnection();
              conn.setAutoCommit(true);
  
              usedConnctionCount = pds.getBorrowedConnectionsCount();
              AvailableConnctionCount = pds.getAvailableConnectionsCount();
  
              totalCount = usedConnctionCount + AvailableConnctionCount;
  
  
              return conn;
          } else {
              print = "All connections in the database pool are now busy...";
              System.out.println(print);
              throw new Exception("All connections in the database pool are now busy.");
          }
      } catch (Exception e) {
          e.printStackTrace();
          throw e;
      }
  }
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/OracleShardingKeyBuilder
  at oracle.ucp.jdbc.PoolDataSourceFactory.getPoolDataSource(PoolDataSourceFactory.java:48)
  </code></pre>