use of org.jkiss.dbeaver.model.DBPDataSourceURLProvider in project dbeaver by serge-rider.
the class PostgreDataSourceProvider method getConnectionURL.
@Override
public String getConnectionURL(DBPDriver driver, DBPConnectionConfiguration connectionInfo) {
DBAAuthModel authModel = connectionInfo.getAuthModel();
if (authModel instanceof DBPDataSourceURLProvider) {
return ((DBPDataSourceURLProvider) authModel).getConnectionURL(driver, connectionInfo);
}
PostgreServerType serverType = PostgreUtils.getServerType(driver);
if (serverType.supportsCustomConnectionURL()) {
return JDBCURL.generateUrlByTemplate(driver, connectionInfo);
}
StringBuilder url = new StringBuilder();
url.append("jdbc:postgresql://");
url.append(connectionInfo.getHostName());
if (!CommonUtils.isEmpty(connectionInfo.getHostPort())) {
url.append(":").append(connectionInfo.getHostPort());
}
url.append("/");
if (!CommonUtils.isEmpty(connectionInfo.getDatabaseName())) {
url.append(connectionInfo.getDatabaseName());
}
// }
return url.toString();
}
use of org.jkiss.dbeaver.model.DBPDataSourceURLProvider in project dbeaver by dbeaver.
the class PostgreDataSourceProvider method getConnectionURL.
@Override
public String getConnectionURL(DBPDriver driver, DBPConnectionConfiguration connectionInfo) {
DBAAuthModel authModel = connectionInfo.getAuthModel();
if (authModel instanceof DBPDataSourceURLProvider) {
return ((DBPDataSourceURLProvider) authModel).getConnectionURL(driver, connectionInfo);
}
PostgreServerType serverType = PostgreUtils.getServerType(driver);
if (serverType.supportsCustomConnectionURL()) {
return JDBCURL.generateUrlByTemplate(driver, connectionInfo);
}
StringBuilder url = new StringBuilder();
url.append("jdbc:postgresql://");
url.append(connectionInfo.getHostName());
if (!CommonUtils.isEmpty(connectionInfo.getHostPort())) {
url.append(":").append(connectionInfo.getHostPort());
}
url.append("/");
if (!CommonUtils.isEmpty(connectionInfo.getDatabaseName())) {
url.append(connectionInfo.getDatabaseName());
}
// }
return url.toString();
}
Aggregations