// Path: src/main/java/com/dukenlidb/nlidb/model/DBConnectionConfig.java
// @Builder
// @Value
// public class DBConnectionConfig {
// 
//     String host;
//     String port;
//     String database;
//     String username;
//     String password;
// 
//     @JsonIgnore
//     public String getUrl() {
//         return "jdbc:postgresql://"
//                 + host + ":" + port
//                 + "/" + database;
//     }
// 
//     @JsonIgnore
//     public Properties getProperties() {
//         Properties props = new Properties();
//         props.setProperty("user", username);
//         props.setProperty("password", password);
//         return props;
//     }
// 
// }


import org.springframework.stereotype.Service;
import com.dukenlidb.nlidb.model.DBConnectionConfig;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
package com.dukenlidb.nlidb.service;



@Service
public class DBConnectionService {

// Path: src/main/java/com/dukenlidb/nlidb/model/DBConnectionConfig.java
// @Builder
// @Value
// public class DBConnectionConfig {
// 
//     String host;
//     String port;
//     String database;
//     String username;
//     String password;
// 
//     @JsonIgnore
//     public String getUrl() {
//         return "jdbc:postgresql://"
//                 + host + ":" + port
//                 + "/" + database;
//     }
// 
//     @JsonIgnore
//     public Properties getProperties() {
//         Properties props = new Properties();
//         props.setProperty("user", username);
//         props.setProperty("password", password);
//         return props;
//     }
// 
// }


// Path: src/main/java/com/dukenlidb/nlidb/service/DBConnectionService.java
import org.springframework.stereotype.Service;
import com.dukenlidb.nlidb.model.DBConnectionConfig;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

package com.dukenlidb.nlidb.service;



@Service
public class DBConnectionService {

    public Connection getConnection(DBConnectionConfig config) throws SQLException {