예제 #1
0
 /**
  * Returns new Pooled {@link DataSource} implementation
  *
  * <p>In case this function won't work - use {@link #createDataSource(java.util.Properties)}
  *
  * @param url Database connection url
  * @return new Pooled {@link DataSource} implementation
  * @throws SQLException
  */
 public static DataSource createDataSource(String url) throws SQLException {
   try {
     return MjdbcPoolBinder.createDataSource(url);
   } catch (NoClassDefFoundError ex) {
     throw new NoClassDefFoundError(ERROR_COULDNT_FIND_POOL_PROVIDER);
   }
 }
예제 #2
0
 /**
  * Returns new Pooled {@link DataSource} implementation
  *
  * <p>In case this function won't work - use {@link #createDataSource(java.util.Properties)}
  *
  * @param driverClassName Driver Class name
  * @param url Database connection url
  * @param userName Database user name
  * @param password Database user password
  * @return new Pooled {@link DataSource} implementation
  * @throws SQLException
  */
 public static DataSource createDataSource(
     String driverClassName, String url, String userName, String password) throws SQLException {
   try {
     return MjdbcPoolBinder.createDataSource(driverClassName, url, userName, password);
   } catch (NoClassDefFoundError ex) {
     throw new NoClassDefFoundError(ERROR_COULDNT_FIND_POOL_PROVIDER);
   }
 }