Issue
I want to use rqlite
for my sqlite database replication on a java desktop application. i have found a java coding example in here. But I have no idea how to add rqlite binary/library files to the project.
I'm using Netbeans
Ant
for create the project. I used add jar
library files to the project. But I can't find any jar
files for rqlite
If anyone here have any experience or knowledge, please let me know how to do it
thanks in advance.
Solution
There are 2 parts to this. You may already have done part 1, but I mention it for clarity.
(1) The rqlite database
You install rqlite (the relational database) separately from your Java project - just like you would install other relational database products separately. You can get pre-built binaries here (see the "Assets" section) or you can build from source.
Note that the pre-built binaries are only for Linux and Mac. Otherwise, see the notes for Windows in the above link, for more details.
rqlite is also available via Docker build.
(2) Accessing your rqlite database via Java
Here are two approaches:
(a) You can use rqlite's data API using any suitable HTTP client. Java has a built-in HTTP client from Java 11 onwards.
There is also a Google HTTP client - and probably various other similar libraries.
So, with the above approach, there is no "rqlite client" JAR file.
(b) Use the rqlite-java library you linked to in your question (I have never tried it). I see that this library uses Google's HTTP client, internally. In other words, it looks like it is a wrapper around the rqlite data API, mentioned above.
There does not appear to be a pre-built JAR for this library (at least not that I was able to find) so you will need to build that yourself from the GitHub repository. You can fork (copy) the repo into a new, separate Java project to build it on your machine, using Maven (or you can download all the source code as a zip file).
If you are not familiar with these GitHub & Maven build processes, there are guides and tutorials to get you started.
You tagged your question as a NetBeans question - so you would create a "Java with Maven" project for this.
Answered By - andrewJames
Answer Checked By - Marie Seifert (JavaFixing Admin)