Skip to content

Commit

Permalink
use 'mssql' instead of 'sqlserver'
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainJuge committed Sep 8, 2021
1 parent 54bae11 commit 8f28861
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ ConnectionMetaData parse(String connectionUrl, String instance, String user) {
if (indexOfInstance > 0) {
host = host.substring(0, indexOfInstance);
}
return new ConnectionMetaData(dbVendor, host, port, instance, user);
return new ConnectionMetaData("mssql", host, port, instance, user);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,23 @@ void testMariadb() {
@Test
void testSqlserver() {
// https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15
testUrl("jdbc:sqlserver://myhost\\instance:666", "sqlserver", "myhost", 666);
testUrl("jdbc:sqlserver://myhost\\instance:666;prop1=val1;prop2=val2", "sqlserver", "myhost", 666);
testUrl("jdbc:sqlserver://myhost:666", "sqlserver", "myhost", 666);
testUrl("jdbc:sqlserver://myhost:666;prop1=val1;prop2=val2", "sqlserver", "myhost", 666);
testUrl("jdbc:sqlserver://myhost\\instance", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost\\instance;prop1=val1;prop2=val2", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost;prop1=val1;prop2=val2", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://", "sqlserver", "localhost", 1433);
testUrl("jdbc:sqlserver://;prop1=val1;prop2=val2", "sqlserver", "localhost", 1433);
testUrl("jdbc:sqlserver://;", "sqlserver", "localhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://;prop1=val1;serverName=myhost", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost;prop1=val1", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost\\instance;prop1=val1", "sqlserver", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost\\instance:666", "mssql", "myhost", 666);
testUrl("jdbc:sqlserver://myhost\\instance:666;prop1=val1;prop2=val2", "mssql", "myhost", 666);
testUrl("jdbc:sqlserver://myhost:666", "mssql", "myhost", 666);
testUrl("jdbc:sqlserver://myhost:666;prop1=val1;prop2=val2", "mssql", "myhost", 666);
testUrl("jdbc:sqlserver://myhost\\instance", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost\\instance;prop1=val1;prop2=val2", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://myhost;prop1=val1;prop2=val2", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://", "mssql", "localhost", 1433);
testUrl("jdbc:sqlserver://;prop1=val1;prop2=val2", "mssql", "localhost", 1433);
testUrl("jdbc:sqlserver://;", "mssql", "localhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://;prop1=val1;serverName=myhost", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost;prop1=val1", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://;serverName=myhost\\instance;prop1=val1", "mssql", "myhost", 1433);
testUrl("jdbc:sqlserver://;serverName=3ffe:8311:eeee:f70f:0:5eae:10.203.31.9\\instance;prop1=val1",
"sqlserver", "3ffe:8311:eeee:f70f:0:5eae:10.203.31.9", 1433);
"mssql", "3ffe:8311:eeee:f70f:0:5eae:10.203.31.9", 1433);
}

@Test
Expand Down

0 comments on commit 8f28861

Please sign in to comment.