根据DatabaseMetaData确定数据库类型
DataSource dataSource = dataSourceTransactionManager.getDataSource(); connection = DataSourceUtils.getConnection(dataSource); String databaseProduectName = connection.getMetaData().getDatabaseProductName(); String upperDatabaseProductName = databaseProductName.toUpperCase(); // DATABASE_DB2 // DATABASE_ORACLE // DATABASE_MYSQL