diff options
author | 2018-09-19 14:35:00 +0200 | |
---|---|---|
committer | 2018-09-28 07:39:18 +0200 | |
commit | 56f2ad282e7a8d316b92878ae151767fea847265 (patch) | |
tree | 6fff9ecd3b4c197ff37bd0f96d430edd75d93adf /vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java | |
parent | 52cb6586c32cb99b1aab99bebfa51b01d98beba4 (diff) |
HealthCheckController/test refactor
Issue-ID: VID-312
Change-Id: Iabdb91c9b4940ff7a173656819ad5fa807a734e9
Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java b/vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java new file mode 100644 index 00000000..bd7a67b5 --- /dev/null +++ b/vid-app-common/src/main/java/org/onap/vid/dao/ConnectionFactory.java @@ -0,0 +1,20 @@ +package org.onap.vid.dao; + +import org.springframework.stereotype.Component; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +import static com.google.common.base.Preconditions.checkNotNull; + +@Component +public class ConnectionFactory { + + public Connection getConnection(String url, String username, String password) throws SQLException { + checkNotNull(url); + checkNotNull(username); + checkNotNull(password); + return DriverManager.getConnection(url, username, password); + } +} |