Browse Source

Merge pull request #15841 from mrotteveel

* pr/15841:
  Polish "Add support for jdbc:firebird: url prefix"
  Add support for jdbc:firebird: url prefix
pull/15937/head
Stephane Nicoll 7 years ago
parent
commit
48fcaca155
  1. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java
  2. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java

4
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -140,7 +140,7 @@ public enum DatabaseDriver {
@Override @Override
protected Collection<String> getUrlPrefixes() { protected Collection<String> getUrlPrefixes() {
return Collections.singleton("firebirdsql"); return Arrays.asList("firebirdsql", "firebird");
} }
@Override @Override

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2018 the original author or authors. * Copyright 2012-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -129,6 +129,8 @@ public class DatabaseDriverTests {
.isEqualTo(DatabaseDriver.SQLSERVER); .isEqualTo(DatabaseDriver.SQLSERVER);
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:firebirdsql://localhost/sample")) assertThat(DatabaseDriver.fromJdbcUrl("jdbc:firebirdsql://localhost/sample"))
.isEqualTo(DatabaseDriver.FIREBIRD); .isEqualTo(DatabaseDriver.FIREBIRD);
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:firebird://localhost/sample"))
.isEqualTo(DatabaseDriver.FIREBIRD);
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:db2://localhost:50000/sample ")) assertThat(DatabaseDriver.fromJdbcUrl("jdbc:db2://localhost:50000/sample "))
.isEqualTo(DatabaseDriver.DB2); .isEqualTo(DatabaseDriver.DB2);
assertThat(DatabaseDriver.fromJdbcUrl("jdbc:as400://localhost")) assertThat(DatabaseDriver.fromJdbcUrl("jdbc:as400://localhost"))

Loading…
Cancel
Save