try (Connection connection = jdbcTemplate.getDataSource().getConnection()) { databaseProductName = connection.getMetaData().getDatabaseProductName(); } catch (SQLException e) { throw new DefinedQueryRuntimeException("获取数据库类型失败!", e); }