尽管将其添加到application.properties,但无法将外部JDBC jar文件添加到Spring Boot

时间:2017-08-01 12:13:35

标签: java spring-boot jdbc

我尝试按照提及here的说明添加SAP HANA数据库的驱动程序。驱动程序作为jar文件提供,并已添加到pom.xml:

spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:sap://<YOUR SAP HANA IP>:host
spring.datasource.username=sap_hana_user
spring.datasource.password=sap_hana_password
spring.datasource.driver-class-name=com.sap.db.jdbc.Driver

我的应用程序属性如下:

Cannot determine embedded database driver class for database type NONE

然而,这没有用,我仍然收到错误消息:

application.resources

做了什么工作,正如所提到的here以编程方式添加数据源,并删除了Application.java文件。所以,最后,我的@SpringBootApplication public class Application extends SpringBootServletInitializer { @Bean @Primary public DataSource dataSource() { return DataSourceBuilder.create().username("user_name_sap_hana").password("password_sap_hana").url("jdbc:sap://<YOUR SAP HANA IP>:port").driverClassName("com.sap.db.jdbc.Driver").build();//https://stackoverflow.com/a/28822145/1243462 ; https://stackoverflow.com/a/1336965/1243462 } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } public static void main(String[] args) { SpringApplication.run(Application.class, args); } } 看起来像:

application.resources

有人可以解释一下我做错了吗?除了在#include <stdio.h> # define N 21 int main() { int arr[N]; int *p, *end, *q; int i, x; //initialize the array for (i = 1; i <= N; i++) arr[i - 1] = i; printf("%d", arr[0]); end = &arr[N - 1]; p = &arr[1]; while (p < end) { printf(", %d", *p); q = p; x = *p; while (q <= end) { q += x; *q = 0; } do p++; while ((*p == 0) && (p < end)); } printf("\n"); return 0; } 中输入这些详细信息之外,第一种方法没有提到必须做任何事情。

0 个答案:

没有答案