简体   繁体   English

无法使用Spring Boot连接到Impala数据库

[英]Can't Connect to Impala Database with Spring Boot

I'm trying to connect to an impala db in spring boot, however I've been getting various errors such as Cannot determine embedded database driver class for database type NONE 我正在尝试在春季启动时连接到Impala数据库,但是却遇到了各种错误,例如Cannot determine embedded database driver class for database type NONE

I have been trying to debug the errors. 我一直在尝试调试错误。 For this error, I tried specifying the class from another post , but it did not fix the problem 对于此错误,我尝试从另一篇文章中指定类,但未能解决问题

I have the jdbc jars located in the project, and am able to connect with them when not using spring-boot 我在项目中有jdbc jar,并且在不使用spring-boot时能够与它们连接

Code

application.properties application.properties

where myHost is a server running the impala daemon 其中myHost是运行impala守护程序的服务器

app.datasource.url=jdbc:impala://myHost:21050/default;auth=noSasl
app.datasource.driver-class-name=com.cloudera.impala.jdbc41.Driver

DemoApplication.java (main class) DemoApplication.java(主类)

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {
    public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
    }
}

ImpalaDao 黑斑羚

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.sql.DataSource;

@Repository
public class ImpalaDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
}

spring boot does not recognize the impala driver. spring boot无法识别impala驱动程序。 In the autoconfigurations of spring Boot does not have autoconfiguracion of Impala. 在spring的自动配置中,Boot没有Impala的自动配置。 You have to configure it ad-hoc or make your own autoconfiguration. 您必须临时配置它或进行自己的自动配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM