MOCA client for Java, sponsored by LabelZoom.
Add a new maven
closure to your repositories
section that points to this repository.
repositories {
mavenCentral() // You probably already have this
maven {
url = uri('https://maven.pkg.github.com/labelzoom/labelzoom-moca-client-java')
credentials {
username = project.findProperty('gpr.user') ?: System.getenv('GITHUB_ACTOR') // your GitHub username goes here
password = project.findProperty('gpr.key') ?: System.getenv('GITHUB_TOKEN') // your GitHub PAT (Personal Access Token) goes here
}
}
}
Add the dependency to your implementation
dependencies:
dependencies {
implementation 'com.labelzoom:labelzoom-moca-client-java:1.0.2'
}
TODO
See tests for more examples.
try (final MocaConnection conn = new HttpMocaConnection(url, userId, password))
{
try (final ResultSet res = conn.execute("publish data where message = 'Hello World!'"))
{
res.next();
System.out.println("Message: " + res.getString("message"));
}
}
catch (final SQLException | IOException e)
{
e.printStackTrace();
}
try (final MocaConnection conn = new HttpMocaConnection(url, userId, password);
final ResultSet res = conn.execute("publish data where message = 'Hello World!'"))
{
res.next();
System.out.println("Message: " + res.getString("message"));
}
catch (final SQLException | IOException e)
{
e.printStackTrace();
}