Commit 09c53c7c authored by eddie.woo's avatar eddie.woo

modify

parent e277a056
package pwc.taxtech.atms.common.datasource;
import com.alibaba.druid.pool.DruidDataSource;
import com.beust.jcommander.ParameterException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.pool2.KeyedPooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
......@@ -19,6 +20,9 @@ public class DataSourceFactory implements KeyedPooledObjectFactory<String, Druid
@Override
public PooledObject<DruidDataSource> makeObject(String s) throws Exception {
if (StringUtils.isBlank(s)) {
throw new ParameterException("empty database name.");
}
DruidDataSource dynamicDataSource = new DruidDataSource();
String url = StringUtils.replace(dataSourceConfig.getUrl(), SYMBOL, s);
dynamicDataSource.setUrl(url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment