mirror of https://github.com/apache/openjpa.git
OPENJPA-656: reusing existing error message key from a different package
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@676081 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
026c96d513
commit
85b0b0b45b
|
@ -60,6 +60,8 @@ public class DataSourceFactory {
|
||||||
|
|
||||||
private static final Localizer _loc = Localizer.forPackage
|
private static final Localizer _loc = Localizer.forPackage
|
||||||
(DataSourceFactory.class);
|
(DataSourceFactory.class);
|
||||||
|
protected static Localizer _eloc =
|
||||||
|
Localizer.forPackage(DelegatingDataSource.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a datasource using the given configuration.
|
* Create a datasource using the given configuration.
|
||||||
|
@ -251,13 +253,11 @@ public class DataSourceFactory {
|
||||||
|
|
||||||
static OpenJPAException newConnectException(JDBCConfiguration conf,
|
static OpenJPAException newConnectException(JDBCConfiguration conf,
|
||||||
boolean factory2, Exception cause) {
|
boolean factory2, Exception cause) {
|
||||||
return new UserException(_loc.get("conn-failed", factory2
|
return new UserException(_eloc.get("poolds-null", factory2
|
||||||
? new Object[]{conf.getConnection2DriverName(),
|
? new Object[]{conf.getConnection2DriverName(),
|
||||||
conf.getConnection2URL(),
|
conf.getConnection2URL()}
|
||||||
conf.getConnection2Properties()}
|
|
||||||
: new Object[]{conf.getConnectionDriverName(),
|
: new Object[]{conf.getConnectionDriverName(),
|
||||||
conf.getConnectionURL(),
|
conf.getConnectionURL()}),
|
||||||
conf.getConnectionProperties()}),
|
|
||||||
cause).setFatal(true);
|
cause).setFatal(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.apache.openjpa.jdbc.sql.DBDictionary;
|
import org.apache.openjpa.jdbc.sql.DBDictionary;
|
||||||
|
import org.apache.openjpa.lib.jdbc.DelegatingDataSource;
|
||||||
import org.apache.openjpa.lib.util.J2DoPrivHelper;
|
import org.apache.openjpa.lib.util.J2DoPrivHelper;
|
||||||
import org.apache.openjpa.lib.util.Localizer;
|
import org.apache.openjpa.lib.util.Localizer;
|
||||||
import org.apache.openjpa.util.StoreException;
|
import org.apache.openjpa.util.StoreException;
|
||||||
|
@ -51,6 +52,8 @@ public class SimpleDriverDataSource
|
||||||
|
|
||||||
protected static Localizer _loc =
|
protected static Localizer _loc =
|
||||||
Localizer.forPackage(SimpleDriverDataSource.class);
|
Localizer.forPackage(SimpleDriverDataSource.class);
|
||||||
|
protected static Localizer _eloc =
|
||||||
|
Localizer.forPackage(DelegatingDataSource.class);
|
||||||
|
|
||||||
public Connection getConnection()
|
public Connection getConnection()
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
@ -77,8 +80,8 @@ public class SimpleDriverDataSource
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
Connection con = getDriver().connect(_connectionURL, props);
|
Connection con = getDriver().connect(_connectionURL, props);
|
||||||
if (con == null) {
|
if (con == null) {
|
||||||
throw new SQLException(_loc.get("conn-failed",
|
throw new SQLException(_eloc.get("poolds-null",
|
||||||
_connectionDriverName, _connectionURL, props).getMessage());
|
_connectionDriverName, _connectionURL).getMessage());
|
||||||
}
|
}
|
||||||
return con;
|
return con;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue