Skip to content

Commit

Permalink
Polish SQL Server support and fix unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottfrederick committed Jul 24, 2015
1 parent 9e78abe commit 9b4139c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import org.springframework.cloud.service.common.SqlServerServiceInfo;

public class SqlServerServiceInfoCreator extends
RelationalServiceInfoCreator<SqlServerServiceInfo> {
public class SqlServerServiceInfoCreator extends RelationalServiceInfoCreator<SqlServerServiceInfo> {

public SqlServerServiceInfoCreator() {
super(new Tags(), SqlServerServiceInfo.SQLSERVER_SCHEME); }
super(new Tags(), SqlServerServiceInfo.SQLSERVER_SCHEME);
}

@Override
public SqlServerServiceInfo createServiceInfo(String id, String url) {
return new SqlServerServiceInfo(id, url);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ public class SqlServerServiceInfo extends RelationalServiceInfo {
public SqlServerServiceInfo(String id, String url) {
super(id, url, JDBC_URL_TYPE);
}

@Override
public String getJdbcUrl()
{
return String.format("jdbc:%s://%s:%d;database=%s;user=%s;password=%s;",
jdbcUrlDatabaseType,

@Override
public String getJdbcUrl() {
if (getUriInfo().getUriString().startsWith(JDBC_PREFIX)) {
return getUriInfo().getUriString();
}

return String.format("jdbc:%s://%s:%d;database=%s;user=%s;password=%s",
jdbcUrlDatabaseType,
getHost(), getPort(), getPath(), getUserName(), getPassword());
}
}
}

0 comments on commit 9b4139c

Please sign in to comment.