mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved jndi datasource support.
This commit is contained in:
@@ -1788,6 +1788,16 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password) throws SQLException {
|
||||
if (this.username == null
|
||||
&& this.password == null
|
||||
&& username != null
|
||||
&& password != null) {
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
|
||||
return getConnection();
|
||||
}
|
||||
|
||||
if (!StringUtils.equals(username, this.username)) {
|
||||
throw new UnsupportedOperationException("Not supported by DruidDataSource");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user