Tutorial: Programming with Db2 Graph
Db2 Graph supports programmatic access through the db2graph object to the TinkerPop Gremlin server hosted within your Db2 Graph container. The db2graph object mirrors the functionality of the manage command. For each session, connection, and graph command available through the manage command, there is an equivalent db2graph method that takes same parameters as manage.
Attention:
With the release of Db2 11.5.9, Db2
Graph is
discontinued. You can still run Db2
Graph as a
standalone application with Db2 11.5.6 through
11.5.8.
The Db2
Graph container
includes several sample programs that use the
manage commands to create, open and
query graphs. To access these samples, execute the following to copy files onto your
system:docker cp <graph container name>:/db2graph_server/samples <destination path>where
<graph container name>is the name of the container (normally db2graph).<destination path>is where the samples folder and its contents are placed.
While Gremlin drivers are supported by a variety of programming languages, this section focuses on Java, JavaScript and Python. The following sessions walk through each of the sample programs to point out language-specific considerations.