useful error message for connection establishment problem

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1178635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2011-10-03 23:24:20 +00:00
parent 4ef9c9f6f1
commit accc2e01fb
1 changed files with 3 additions and 5 deletions

View File

@ -60,10 +60,8 @@ import org.apache.openjpa.util.UserException;
*/
public class DataSourceFactory {
private static final Localizer _loc = Localizer.forPackage
(DataSourceFactory.class);
protected static Localizer _eloc =
Localizer.forPackage(DelegatingDataSource.class);
private static final Localizer _loc = Localizer.forPackage(DataSourceFactory.class);
protected static Localizer _eloc = Localizer.forPackage(DelegatingDataSource.class);
/**
* Create a datasource using the given configuration.
@ -73,7 +71,7 @@ public class DataSourceFactory {
String driver = (factory2) ? conf.getConnection2DriverName()
: conf.getConnectionDriverName();
if (StringUtils.isEmpty(driver))
throw new UserException(_loc.get("no-driver", driver)).
throw new UserException(_loc.get("no-driver", conf)).
setFatal(true);
ClassLoader loader = conf.getClassResolverInstance().