diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java index c4086b4539..d727cdc3cc 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DatabaseType.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2023 the original author or authors. + * Copyright 2006-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -103,6 +103,9 @@ else if (databaseProductName.contains("AS") && (databaseProductVersion.startsWit databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName); } } + else if (StringUtils.hasText(databaseProductName) && databaseProductName.startsWith("EnterpriseDB")) { + databaseProductName = "PostgreSQL"; + } else { databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName); } diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DatabaseTypeTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DatabaseTypeTests.java index 9c786e8310..2374153b3b 100644 --- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DatabaseTypeTests.java +++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DatabaseTypeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2022 the original author or authors. + * Copyright 2008-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,6 +138,12 @@ void testFromMetaDataForPostgres() throws Exception { assertEquals(POSTGRES, DatabaseType.fromMetaData(ds)); } + @Test + void testFromMetaDataForEnterpriseDB() throws Exception { + DataSource ds = DatabaseTypeTestUtils.getMockDataSource("EnterpriseDB"); + assertEquals(POSTGRES, DatabaseType.fromMetaData(ds)); + } + @Test void testFromMetaDataForSybase() throws Exception { DataSource ds = DatabaseTypeTestUtils.getMockDataSource("Adaptive Server Enterprise");