首先,我在Java开发领域非常新。
我正在和Dropwizard一起做一个小项目。我想使用JDBI与我的数据库进行交互。但是,我不能导入DataSourceFactory。我在用Maven。据我所读,我认为JDBI模块是核心模块之一。我尝试显式地添加依赖项,仍然找不到DataSourceFactory。这些是我的依赖:
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi3</artifactId>
<version>2.1.2</version>
</dependency>
</dependencies>希望你们中有人能帮我。
提前感谢!
最好的
发布于 2022-09-13 10:40:14
还需要添加数据库依赖项:
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-db</artifactId>
<version>2.1.2</version>
</dependency>https://stackoverflow.com/questions/73691185
复制相似问题