gpt4 book ai didi

java - 在 Gradle Java 项目中使用 Sqlite JDBC 驱动程序

转载 作者:行者123 更新时间:2023-12-02 14:33:13 25 4
gpt4 key购买 nike

在本教程中,http://www.sqlitetutorial.net/sqlite-java/sqlite-jdbc-driver/ ,关于在 java 中使用 sqlite,首先从以下网站下载 JDBC 驱动程序 https://bitbucket.org/xerial/sqlite-jdbc/downloads/ 。之后,它使用 Maven 构建系统将驱动程序添加到项目中。

我环顾四周,我不明白如果你使用 Gradle,你应该做什么?在编写代码之前应该采取哪些步骤?

如果这有什么区别的话,我正在使用 Intellij IDE。

最佳答案

Sqlite JDBC 驱动程序在 Maven 中央存储库中可用:SQLite JDBC

因此,在 Gradle 中,您可以在 build.gradle 中添加此依赖项,如下所示:

repositories {
mavenCentral()
}

dependencies {
compile group:'org.xerial', name:'sqlite-jdbc', version:'3.8.11.2'
}

或者在 pom.xml 文件中的 Maven 项目中:

<dependencies>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11.2</version>
</dependency>
</dependencies>

关于java - 在 Gradle Java 项目中使用 Sqlite JDBC 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50377264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com