-
Notifications
You must be signed in to change notification settings - Fork 7
Java
Dmitry Romanov edited this page Oct 23, 2017
·
5 revisions
Java API allows one to read RCDB condition values for the run. It doesn't provide possibility of run selection queries at this point.
Java API comes as sources (in Kotlin) and as ready to use Java precompiled .jar file
- Java API is located in $RCDB_HOME/java directory.
- Precompiled jar is located in $RCDB_HOME/java/out/artifacts
The example shows how to get values from RCDB:
// Connect
Connection con("mysql://rcdb@hallddb/rcdb");
// Get event_count for run 10173
auto cnd = prov.GetCondition(10173, "event_count");
// Check event_count has a value for the run
if(!cnd == null) {
System.err.println("event_count condition is not set for the run");
return;
}
// Get value!
event_count = cnd.toInt();
Here is the list of condition ToXXX functions and what values they are for:
Int toInt(); /// For int values
Bool toBool(); /// For bool or int in DB
Double toDouble(); /// For Double or int in DB
String toString(); /// For Json, String or Blob
Date toDate(); /// For time value
org.rcdb.ValueTypes /// type enum
Examples are located in $RCDB_HOME/java/examples folder.
List of examples:
Getting started & basic usage:
- Installation
- Select values tutorial (python)
- Query syntax
- Add data (python)
- CLI Basics
RCDB Explained:
- Connection
- DB and APIs structure
- SQL examples
- Creating condition types
- Adding condition values
- Saving files
- SQLAlchemy
- Logging
- Performance
Command line tools:
DAQ: