{"id":13273633,"url":"https://github.com/xerial/sqlite-jdbc","last_synced_at":"2025-05-12T05:21:24.451Z","repository":{"id":19440808,"uuid":"22684655","full_name":"xerial/sqlite-jdbc","owner":"xerial","description":"SQLite JDBC Driver","archived":false,"fork":false,"pushed_at":"2025-05-06T01:49:49.000Z","size":572879,"stargazers_count":3000,"open_issues_count":60,"forks_count":638,"subscribers_count":103,"default_branch":"master","last_synced_at":"2025-05-12T02:39:49.858Z","etag":null,"topics":["database","java","jdbc","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xerial.png","metadata":{"files":{"readme":".github/README_IMAGES/android_jnilibs.png","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-06T14:01:00.000Z","updated_at":"2025-05-11T07:33:13.000Z","dependencies_parsed_at":"2023-10-03T13:40:00.338Z","dependency_job_id":"59a57d5d-7078-49a6-9371-1cdf61a2ddbc","html_url":"https://github.com/xerial/sqlite-jdbc","commit_stats":{"total_commits":1540,"total_committers":155,"mean_commits":9.935483870967742,"dds":0.7259740259740259,"last_synced_commit":"4a419981aab112b398ca0a998c9b053d07b7fcba"},"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerial%2Fsqlite-jdbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerial%2Fsqlite-jdbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerial%2Fsqlite-jdbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xerial%2Fsqlite-jdbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xerial","download_url":"https://codeload.github.com/xerial/sqlite-jdbc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672697,"owners_count":21945480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","java","jdbc","sqlite"],"created_at":"2024-07-29T14:14:47.339Z","updated_at":"2025-05-12T05:21:19.422Z","avatar_url":"https://github.com/xerial.png","language":"Java","readme":"= SQLite JDBC Driver\n:project-version: 3.47.0.0\n\nimage:https://img.shields.io/github/actions/workflow/status/xerial/sqlite-jdbc/ci.yml?branch=master[GitHub Workflow Status (branch),link=https://github.com/xerial/sqlite-jdbc/actions/workflows/ci.yml?query=branch%3Amaster]\nimage:https://badges.gitter.im/xerial/sqlite-jdbc.svg[Join the chat,link=https://gitter.im/xerial/sqlite-jdbc?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge]\nimage:https://maven-badges.herokuapp.com/maven-central/org.xerial/sqlite-jdbc/badge.svg[Maven Central,link=https://maven-badges.herokuapp.com/maven-central/org.xerial/sqlite-jdbc/]\nimage:https://javadoc.io/badge2/org.xerial/sqlite-jdbc/javadoc.svg[javadoc,link=https://javadoc.io/doc/org.xerial/sqlite-jdbc]\nimage:https://img.shields.io/nexus/s/org.xerial/sqlite-jdbc?color=blue\u0026label=maven%20snapshot\u0026server=https%3A%2F%2Foss.sonatype.org%2F[Sonatype Nexus (Snapshots),link=https://oss.sonatype.org/content/repositories/snapshots/org/xerial/sqlite-jdbc/]\n\nSQLite JDBC is a library for accessing and creating https://www.sqlite.org[SQLite] database files in Java.\n\nOur SQLiteJDBC library requires no configuration since native libraries for major OSs, including Windows, macOS, Linux etc., are assembled into a single JAR (Java Archive) file.\n\n== Project Status\n\nThe project is maintained, but is not being actively developed:\n\n- We follow every new version of SQLite and will release a corresponding version of our driver.\n- Bugs will be investigated, and fixed if possible.\n- New features are driven by pull requests.\n\nThe current maintainer of the project is https://github.com/gotson[gotson].\n\n== Usage\n\n➡️ More usage examples and configuration are available in link:USAGE.md[USAGE.md]\n\nSQLite JDBC is a library for accessing SQLite databases through the JDBC API. For the general usage of JDBC, see https://docs.oracle.com/javase/tutorial/jdbc/index.html[JDBC Tutorial] or https://www.oracle.com/technetwork/java/javase/tech/index-jsp-136101.html[Oracle JDBC Documentation].\n\n. \u003c\u003cDownload,Download\u003e\u003e `sqlite-jdbc-{project-version}.jar`\nthen append this jar file into your classpath.\n. Open a SQLite database connection from your code. (see the example below)\n\n=== Example usage\n\nAssuming `sqlite-jdbc-{project-version}.jar` is placed in the current directory.\n\n[source,shell,subs=\"attributes+\"]\n----\n\u003e javac Sample.java\n\u003e java -classpath \".;sqlite-jdbc-{project-version}.jar\" Sample   # in Windows\nor\n\u003e java -classpath \".:sqlite-jdbc-{project-version}.jar\" Sample   # in macOS or Linux\nname = leo\nid = 1\nname = yui\nid = 2\n----\n\n=== Sample.java\n\n[source,java]\n----\n    import java.sql.Connection;\n    import java.sql.DriverManager;\n    import java.sql.ResultSet;\n    import java.sql.SQLException;\n    import java.sql.Statement;\n\n    public class Sample\n    {\n      public static void main(String[] args)\n      {\n        // NOTE: Connection and Statement are AutoCloseable.\n        //       Don't forget to close them both in order to avoid leaks.\n        try\n        (\n          // create a database connection\n          Connection connection = DriverManager.getConnection(\"jdbc:sqlite:sample.db\");\n          Statement statement = connection.createStatement();\n        )\n        {\n          statement.setQueryTimeout(30);  // set timeout to 30 sec.\n\n          statement.executeUpdate(\"drop table if exists person\");\n          statement.executeUpdate(\"create table person (id integer, name string)\");\n          statement.executeUpdate(\"insert into person values(1, 'leo')\");\n          statement.executeUpdate(\"insert into person values(2, 'yui')\");\n          ResultSet rs = statement.executeQuery(\"select * from person\");\n          while(rs.next())\n          {\n            // read the result set\n            System.out.println(\"name = \" + rs.getString(\"name\"));\n            System.out.println(\"id = \" + rs.getInt(\"id\"));\n          }\n        }\n        catch(SQLException e)\n        {\n          // if the error message is \"out of memory\",\n          // it probably means no database file is found\n          e.printStackTrace(System.err);\n        }\n      }\n    }\n\n----\n\n== How does SQLiteJDBC work?\n\nOur SQLite JDBC driver package (i.e., `sqlite-jdbc-{project-version}.jar`) contains three\ntypes of native SQLite libraries (`sqlitejdbc.dll`, `sqlitejdbc.dylib`, `sqlitejdbc.so`),\neach of them is compiled for Windows, macOS and Linux. An appropriate native library\nfile is automatically extracted into your OS's temporary folder, when your program\nloads `org.sqlite.JDBC` driver.\n\n=== Supported Operating Systems\n\nSince sqlite-jdbc-3.6.19, the natively compiled SQLite engines will be used for\nthe following operating systems:\n\n|===\n| |x86 |x86_64 |armv5 |armv6 |armv7 |arm64 |ppc64 | riscv64\n\n|Windows |✔ |✔ | | |✔ |✔ | |\n|macOS | |✔ | | | |✔ | |\n|Linux (libc) |✔ |✔ |✔ |✔ |✔ |✔ |✔ |✔ \n|Linux (musl) |✔ |✔ | | | |✔ | |\n|Android (API Level 24+) |✔ |✔ |✔ | | |✔ | |\n|FreeBSD |✔ |✔ | | | |✔ | |\n|===\n\nIn the other OSs not listed above, the pure-java SQLite is used. (Applies to versions before 3.7.15)\n\nIf you want to use the native library for your OS, link:./CONTRIBUTING.md[build the source from scratch].\n\n=== GraalVM native-image support\n\nSqlite JDBC supports https://www.graalvm.org/native-image/[GraalVM native-image] out of the box starting from version 3.40.1.0.\nThere has been rudimentary support for some versions before that, but this was not actively tested by the CI.\n\nBy default, the `sqlitejdbc` library for the compilation target will be included in the native image, accompanied by the required JNI configuration.\nAt runtime, this library will be extracted to the temp folder and loaded from there.\nFor faster startup however, it is recommended to set the `org.sqlite.lib.exportPath` property at build-time.\nThis will export the `sqlitejdbc` library at build-time to the specified directory, and the library will not be included as a resource.\nAs a result, the native image itself will be slightly smaller and the overhead of exporting the library at run-time is eliminated,\nbut you need to make sure the library can be found at run-time.\nThe best way to do this is to simply place the library next to the executable.\n\n==== CLI example\n\n[source,shell]\n----\nnative-image -Dorg.sqlite.lib.exportPath=~/outDir -H:Path=~/outDir -cp foo.jar org.example.Main\n----\n\nThis will place both the `sqlitejdbc` shared library and the native-image output in the `~/outDir` folder.\n\n=== Maven example\n\nThis example uses the https://graalvm.github.io/native-build-tools/latest/index.html[native-build-tools] maven plugin:\n\n[source,xml]\n----\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.graalvm.buildtools\u003c/groupId\u003e\n    \u003cartifactId\u003enative-maven-plugin\u003c/artifactId\u003e\n    \u003cconfiguration\u003e\n        \u003cbuildArgs\u003e\n            \u003cbuildArg\u003e-Dorg.sqlite.lib.exportPath=${project.build.directory}\u003c/buildArg\u003e\n        \u003c/buildArgs\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n----\n\nThis will automatically place the `sqlitejdbc` library in the `/target` folder of your project, creating a functional execution environment.\nWhen packaging the resulting app, simply include the library in the distribution bundle.\n\n== Download\n\nDownload from https://search.maven.org/artifact/org.xerial/sqlite-jdbc[Maven Central] or from the https://github.com/xerial/sqlite-jdbc/releases[releases] page.\n\n[source,xml,subs=\"attributes+\"]\n----\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.xerial\u003c/groupId\u003e\n      \u003cartifactId\u003esqlite-jdbc\u003c/artifactId\u003e\n      \u003cversion\u003e{project-version}\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n----\n\nSnapshots of the development version are available in https://oss.sonatype.org/content/repositories/snapshots/org/xerial/sqlite-jdbc/[Sonatype's snapshots repository].\n\n=== Validating downloads\n\nMaven Central resources are signed using https://gnupg.org/[GPG] and the signature files, ending in .asc, are available in the same location as the other downloads. \n\nThe following key is currently used to sign releases:\n\n---- \n\n-----BEGIN PGP PUBLIC KEY BLOCK-----\nComment: C1CB A75E C9BD 0BAF 8061  9354 59E0 5CE6 1818 7ED4\nComment: Taro L. Saito (For GitHub Actions) \u003cleo@xerial.org\u003e\n\nxjMEYuRVGhYJKwYBBAHaRw8BAQdA2Dp4m1Yhtb1g94pQzzL24FuP6b9KXF8lP9Dh\nhZnynhfNM1Rhcm8gTC4gU2FpdG8gKEZvciBHaXRIdWIgQWN0aW9ucykgPGxlb0B4\nZXJpYWwub3JnPsKUBBMWCgA8FiEEwcunXsm9C6+AYZNUWeBc5hgYftQFAmLkVRoC\nGwMFCwkIBwIDIgIBBhUKCQgLAgQWAgMBAh4HAheAAAoJEFngXOYYGH7UfPwBAK7x\nTVRebZeWcAwmGaMUsbg7SgJou8xnkhByObPLUC/4AQDPsZeYmi4KXyXPzmqhCicd\nY+ZSJWIDQqitK2ujPDFXA844BGLkVRoSCisGAQQBl1UBBQEBB0Atu9kejBi+6wfO\nT0a9z/LYEEdNXM/VX6xt1onKToPPdQMBCAfCeAQYFgoAIBYhBMHLp17JvQuvgGGT\nVFngXOYYGH7UBQJi5FUaAhsMAAoJEFngXOYYGH7UlMABAKyRCazhVyUFg5FOpAnm\nckBY38CaMGPPLXVyY8Kr6dYFAP9wYLu7nsDZCOXkAgS+et4Pk1WZCggoYUkxsX1o\n0KZXBQ==\n=Wyas\n-----END PGP PUBLIC KEY BLOCK-----\n\n----\n\n=== Project versioning explained\n\nThe project's version follows the version of the SQLite library that is bundled in the jar, with an extra digit to denote the project's increment.\n\nFor example, if the SQLite version is `3.39.2`, the project version will be `3.39.2.x`, where `x` starts at 0, and increments with every release that is not changing the SQLite version.\n\nIf the SQLite version is updated to `3.40.0`, the project version will be updated to `3.40.0.0`.\n\n=== Hint for maven-shade-plugin\n\nYou may need to add shade plugin transformer to solve `No suitable driver found for jdbc:sqlite:` issue.\n\n[source,xml]\n----\n\u003ctransformer\n\timplementation=\"org.apache.maven.plugins.shade.resource.AppendingTransformer\"\u003e\n\t\u003cresource\u003eMETA-INF/services/java.sql.Driver\u003c/resource\u003e\n\u003c/transformer\u003e\n----\n\n[source,xml,subs=\"attributes+\"]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.xerial\u003c/groupId\u003e\n    \u003cartifactId\u003esqlite-jdbc\u003c/artifactId\u003e\n    \u003cversion\u003e{project-version}\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n== How can I help?\n\nWe are always looking for:\n\n- *Reviewers* for issues or PRs, you can check image:https://img.shields.io/github/labels/xerial/sqlite-jdbc/review%20wanted[GitHub labels,link=https://github.com/xerial/sqlite-jdbc/labels/review%20wanted]\n- *Contributors* to submit PRs, you can check image:https://img.shields.io/github/labels/xerial/sqlite-jdbc/help%20wanted[GitHub labels,link=https://github.com/xerial/sqlite-jdbc/labels/help%20wanted] and image:https://img.shields.io/github/labels/xerial/sqlite-jdbc/good%20first%20issue[GitHub labels,link=https://github.com/xerial/sqlite-jdbc/labels/good%20first%20issue]\n\nPlease read our link:./CONTRIBUTING.md[contribution] guide.\n","funding_links":[],"categories":["Libraries","Java","Middleware"],"sub_categories":["Java / Kotlin"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxerial%2Fsqlite-jdbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxerial%2Fsqlite-jdbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxerial%2Fsqlite-jdbc/lists"}