Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the property name of connectionInitSqls in DruidDataSourceFactory #6260

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class DruidDataSourceFactory implements ObjectFactory {
public static final String PROP_USERNAME = "username";
public static final String PROP_VALIDATIONQUERY = "validationQuery";
public static final String PROP_VALIDATIONQUERY_TIMEOUT = "validationQueryTimeout";
public static final String PROP_INITCONNECTIONSQLS = "initConnectionSqls";
public static final String PROP_CONNECTIONINITSQLS = "connectionInitSqls";
public static final String PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED = "accessToUnderlyingConnectionAllowed";
public static final String PROP_REMOVEABANDONED = "removeAbandoned";
public static final String PROP_REMOVEABANDONEDTIMEOUT = "removeAbandonedTimeout";
Expand Down Expand Up @@ -97,7 +97,7 @@ public class DruidDataSourceFactory implements ObjectFactory {
PROP_USERNAME,
PROP_VALIDATIONQUERY,
PROP_VALIDATIONQUERY_TIMEOUT,
PROP_INITCONNECTIONSQLS,
PROP_CONNECTIONINITSQLS,
PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED,
PROP_REMOVEABANDONED,
PROP_REMOVEABANDONEDTIMEOUT,
Expand Down Expand Up @@ -368,7 +368,7 @@ public static void config(DruidDataSource dataSource, Map<?, ?> properties) thro
dataSource.setExceptionSorter(value);
}

value = (String) properties.get(PROP_INITCONNECTIONSQLS);
value = (String) properties.get(PROP_CONNECTIONINITSQLS);
if (value != null) {
StringTokenizer tokenizer = new StringTokenizer(value, ";");
dataSource.setConnectionInitSqls(Collections.list(tokenizer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class DruidDataSourceTest_initSql_factory extends TestCase {
protected void setUp() throws Exception {
Properties properties = new Properties();
properties.put(DruidDataSourceFactory.PROP_URL, "jdbc:mock:xxx");
properties.put(DruidDataSourceFactory.PROP_INITCONNECTIONSQLS, ";;select 123");
properties.put(DruidDataSourceFactory.PROP_CONNECTIONINITSQLS, ";;select 123");
dataSource = (DruidDataSource) DruidDataSourceFactory.createDataSource(properties);
}

Expand Down
Loading