Skip to content

Commit 4e16642

Browse files
committed
[KNOWAGE-9298] Fix fallback to stored password when input password is null in DataSource connection logic
1 parent cb54c60 commit 4e16642

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

knowage-core/src/main/java/it/eng/spagobi/api/v2/DataSourceResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public Response testDataSource(IDataSource dataSource) throws Exception {
418418
throw new SpagoBIRestServiceException("Driver not found: " + driver, buildLocaleFromSession(), e);
419419
}
420420

421-
try (Connection connection = DriverManager.getConnection(url, user, pwd)) {
421+
try (Connection connection = DriverManager.getConnection(url, user, pwd == null ? dataSource.getPwd() : pwd)) {
422422
LOGGER.debug("Connection performed successfully");
423423
} catch (SQLException sqlException) {
424424
LOGGER.error("Connection failure", sqlException);

0 commit comments

Comments
 (0)