{"id":18574460,"url":"https://github.com/proofrock/ws4sqlite-client-jvm","last_synced_at":"2026-05-01T19:32:24.530Z","repository":{"id":57736464,"uuid":"454141277","full_name":"proofrock/ws4sqlite-client-jvm","owner":"proofrock","description":"JVM client for ws4sqlite","archived":false,"fork":false,"pushed_at":"2023-02-09T09:22:14.000Z","size":96208,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T14:49:21.388Z","etag":null,"topics":["java","jvm","kotlin-library","sqlite","ws4sqlite"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/proofrock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-31T19:27:52.000Z","updated_at":"2022-08-16T22:48:02.000Z","dependencies_parsed_at":"2025-02-17T14:55:03.775Z","dependency_job_id":null,"html_url":"https://github.com/proofrock/ws4sqlite-client-jvm","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proofrock%2Fws4sqlite-client-jvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proofrock%2Fws4sqlite-client-jvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proofrock%2Fws4sqlite-client-jvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/proofrock%2Fws4sqlite-client-jvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/proofrock","download_url":"https://codeload.github.com/proofrock/ws4sqlite-client-jvm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254442856,"owners_count":22071878,"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":["java","jvm","kotlin-library","sqlite","ws4sqlite"],"created_at":"2024-11-06T23:15:28.690Z","updated_at":"2026-05-01T19:32:19.503Z","avatar_url":"https://github.com/proofrock.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌱 ws4sqlite client for JVM languages\n\nThis is an implementation of a client for [ws4sqlite](https://github.com/proofrock/ws4sqlite) to use with JVM-based\nlanguages. It adds convenience to the communication, by not having to deal with JSON, by performing checks for the \nrequests being well formed and by mapping errors to JDK's exceptions.\n\n## Compatibility\n\nCompatibility is guaranteed as follows:\n\n| ws4sqlite version                    | this library version |\n|--------------------------------------|----------------------|\n| 0.9.x                                | 0.9.x                |\n| 0.10.x                               | 0.10.x               |\n| 0.11.x, 0.12.x, **0.13.x** (current) | **0.11.x** (current) |\n\nThe library requires Java 8 or higher.\n\n## Import\n\nIn maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eit.germanorizzo.ws4sqlite\u003c/groupId\u003e\n    \u003cartifactId\u003ews4sqlite-client-jvm\u003c/artifactId\u003e\n    \u003cversion\u003e0.11.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr gradle:\n\n```\nimplementation group: 'it.germanorizzo.ws4sqlite', name: 'ws4sqlite-client-jvm', version: '0.11.1'\n```\n\n# Usage\n\nThis is a translation in Java code of the \"everything included\" request documented in \n[the docs](https://germ.gitbook.io/ws4sqlite/documentation/requests). It shows the usage, overall; please refer to the\n[javadocs](https://javadoc.io/doc/it.germanorizzo.ws4sqlite/ws4sqlite-client-jvm) for details.\n\n```java\n// Prepare a client for the transmission. It can be saved in a static final field,\n// it's thread safe.\nfinal Client cli =\n        new ClientBuilder()\n                .withURL(\"http://localhost:12321/db2\")\n                .withInlineAuth(\"myUser1\", \"myHotPassword\")\n                .build();\n\n// Prepare the request, adding different queries/statements. See the docs for a \n// detailed explanation, should be fairly 1:1 to the request at\n// https://germ.gitbook.io/ws4sqlite/documentation/requests\nfinal Request req =\n        new RequestBuilder()\n                .addQuery(\"SELECT * FROM TEMP\")\n\n                .addQuery(\"SELECT * FROM TEMP WHERE ID = :id\")\n                .withValues(new MapBuilder().add(\"id\", 1))\n\n                .addStatement(\"INSERT INTO TEMP (ID, VAL) VALUES (0, 'ZERO')\")\n\n                .addStatement(\"INSERT INTO TEMP (ID, VAL) VALUES (:id, :val)\")\n                .withNoFail()\n                .withValues(new MapBuilder().add(\"id\", 1).add(\"val\", \"a\"))\n\n                .addStatement(\"#Q2\")\n                .withValues(new MapBuilder().add(\"id\", 2).add(\"val\", \"b\"))\n                .withValues(new MapBuilder().add(\"id\", 3).add(\"val\", \"c\"))\n\n                .build();\n\n// Call ws4sqlite, obtaining a response\nResponse res;\ntry {\n    res = cli.send(req);\n} catch (ClientException ce) {\n    // Exception possibly raised by the processing of the request.\n    // It contains the same fields from\n    // https://germ.gitbook.io/ws4sqlite/documentation/errors#global-errors\n    // It is a subclass of IOException, so catch it accordingly\n    System.err.format(\"HTTP Code: %d\\n\", ce.getCode());\n    System.err.format(\"At subrequest: %d\\n\", ce.getReqIdx());\n    System.err.format(\"Error: %s\\n\", ce.getMessage());\n    return;\n} catch (IOException e) {\n    // This is thrown when transport errors occurs\n    e.printStackTrace();\n    return;\n}\n\n// Code is 200, because all was exception-less\nassert (res.getStatusCode() == 200);\n\n// Unpacking of the response. Every Response.Item matches a node of the request, \n// and each one has exactly one of the following fields populated/not null:\n// - getError(): reason for the error, if it wasn't successful;\n// - getRowsUpdated(): if the node was a statement and no batching was involved;\n//                     it's the number of updated rows;\n// - getRowsUpdatedBatch(): if the node was a statement and a batch of values was\n//                          provided; it's a List of the numbers of updated rows\n//                          for each batch item;\n// - getResultSet(): if the node was a query; it's a List of Map()s with an item\n//                   per returned record, and each map has the name of the filed\n//                   as a key of each entry, and the value as a value.\nSystem.out.format(\"Number of responses: %d\\n\",\n        res.getResults().size());\n\nSystem.out.format(\"Was 1st response successful? %s\\n\",\n        res.getResults().get(0).isSuccess());\n\nSystem.out.format(\"How many records had the 1st response? %d\\n\",\n        res.getResults().get(0).getResultSet().size());\n\nSystem.out.format(\"What was the first VAL returned? %s\\n\",\n        res.getResults().get(0).getResultSet().get(0).get(\"VAL\"));\n```\n\nThe encryption extension is supported and [documented](https://javadoc.io/doc/it.germanorizzo.ws4sqlite/ws4sqlite-client-jvm). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproofrock%2Fws4sqlite-client-jvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproofrock%2Fws4sqlite-client-jvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproofrock%2Fws4sqlite-client-jvm/lists"}