Using Neo4j database from C++ - c++

my problem is I want to use Neo4j database from a C++ program and I read a lot, but still don't know, how can I start.
First I would like to make a connection between Neo4j and C++, and I would like to create nodes from the C++ program.
Anyone have an example code, or can somebody help, how can I start?

For the upcoming binary remoting protocol there's already a driver written in C, see:
page: http://cleishm.github.io/libneo4j-client/
source: https://github.com/cleishm/libneo4j-client
Please note that this will only work on Neo4j 3.0 builds. As of today, milestone-2 is the most current one. Be sure to read the release notes when working with milestones.

There are no current C/C++ Neo4j drivers targeting Neo4j 2.x that I'm aware of. (See Stefan's answer for a C driver targeting the upcoming Neo4j 3.0 release)
However, using the transactional Cypher API endpoint you should be able to use any C++ http client / JSON parser to interact with Neo4j using Cypher.

Related

Options for Redis 5.0 Cluster with C++

I am exploring Redis 5.0 cluster with C++. I have already seen different options listed on Redis official site, but none of the C++ clients are marked recommended there. I tried C client "hiredis-vip", it worked for my initial prototype, however upon reporting an issue (and its workaround) I am told that this client doesn't seem to officially support Redis 5.0 (see my issue report and its comments here).
I would really appreciate if anyone having experience of using Redis with C/C++ can advise some good C/C++ client options meeting following requirements:
Support for newer versions of Redis (ideally 5.0) with Cluster support
Will be great to have out of the box RedLock implementation as well (for my distributed locking requirement).
Try bredis. Basically it thin wrapper around redis-protocol, so, as soon as the protocol does not change, it will automatically support all redis features, for example streams.
I wrote a C++ client which supports Redis Cluster with STL-like interfaces. You can have a try: redis-plus-plus.
However, by now, it doesn't support RedLock.
auto cluster = RedisCluster("tcp://127.0.0.1:7000");
cluster.set("key", "value");
cluster.lpush("list", {"a", "b", "c"});

getting database connectivity in c++

How can I create a database using SQL in c++?
I tried going according to the steps I found on a website(which required all this to be on codeblocks) by downloading the SQLAPI++ library for c++.
Next it instructed to download oracle c++ call interface, which I downloaded but didn't understand, how to integrate the library with my Codeblocks project.
If you know any other method it would be much appreciated.
In general:
Standard c++ doesn't support SQL database/server connections out of the box. You need to have a 3rd party product to achieve this.
Many SQL standard compliant DB systems support C or C++ APIs you can use for that.
To name a few:
SQLite
PostgreSQL
MariaDB
MySQL
... a by no means complete list ...
Another alternative is to use a generic ODBC interface implementation, which might also support specific database servers, and SQL standard versions.
In particular:
Codeblocks is ypur IDE, it manages projects and their dependencies on libraries.
You seem to have a solution at hand, which uses the sqlapi++ framework library
You need to integrate the underlying SQL server system in turn of configuring that above mentioned API
You may need to link the native support for that specific SQL API of the server system
To do these steps mentioned above you'll need to install (maybe development versions) of the above mentioned APIs, SDKs, ... (whatever they'll call it) and integrate those with your IDE project (related Q&A link regarding this).

Python Database Connection String with Derby Database

Just to let you know about the problem i am facing, I will give a short introduction about what I have been doing.
I am working on a project, where the WEB interface is constructed in Java.
There is a parser built in python, which parses data and stores it into the database.
We were using a MySQL server, but were later asked to change it into DERBY. The java code now works perfectly connecting with the database.
But the python part of the code has problems with connection. I learnt how the derby database works, but find it hard to find articles about connecting to a derby database.
I have the following details:
uname : root
pwd : root
driver class : org.apache.derby.jdbc.EmbeddedDriver
DRIVER LOCATIONS : C:\Users\esusank\AppData\Roaming\RazorSQL\derby\derby10.10.jar
JDBC URL : jdbc:derby:C:\Derby\databases\MyDbTest;create=true
I am finding it hard to find syntax for writing a connection string for DERBY.
I have installed mxODBC driver.
Can someone help me out on this? If you can post some links or some suitable syntax, it will be very much helpful.
To communicate with Derby, you will need to use a JDBC driver. ODBC drivers can't talk directly to Derby; it is a Java-only database.
I believe there are some ODBC-JDBC bridge providers that provide such connection mechanisms, but I'm not sure if they are still in active use.
Another possibility is to use Jython, which is a Java implementation of Python, which may help: see this related question: Derby Database ODBC Connection

using libdrizzle as an async mysql connector

I'm interested in using libdrizzle as a generic asynchronous-capable connector for mysql db for a c++ application (actually as a backend for hiberlite). Since early this year libdrizzle is no longer a separate project and its merged in the same drizzle project, so installing as a separate dependency (unrelated to the rest of drizzle) might have become slightly more complex.
I'm wondering if people has used this library for interfacing to MySql or MariaDB, probably make some mickey mouse benchmarks to have a rough idea how it stands relative to the synchronous default driver.
Also, comments on difficulties to install, setup, pitfalls (the documentation is essentially nonexistent) would be greatly appreciated.
You might want to take a look at ngx_drizzle (drizzle-nginx-module) at github.
From module description:
This is an nginx upstream module integrating libdrizzle into Nginx in a non-blocking and streamming way.
Essentially it provides a very efficient and flexible way for nginx internals to access MySQL, Drizzle, as well as other RDBMS's that support the Drizzle or MySQL wired protocol. Also it can serve as a direct REST interface to those RDBMS backends.
If you're using MySQL, then MySQL 5.0 ~ 5.5 is required. We're not sure if MySQL 5.6+ work; reports welcome!

Connecting to oracle database using C++, the basics

i have a question about the theory here, i'm just starting a project which is based on C++ applications integrating with oracle DB's, i've came to two choices, OCCI, and OCI
the OCCI is said to be aimed at C++ environment, but i was wondering, if it would be any good to use the OCI libraries from my C++ app since it is said to have better performance, or would i run into compatibility issues ?
thanks in advance :)
You can have a look at OTL it's a wrapper above the OCI or OCCI (not sure) will give some templates and samples to start with oracle connection in c++.
In my case, my company have about a thousand stores.
To connect Oracle / Oracle thru an MS C++ multi-thread service we perform the following tests on each thread:
Validate DNS (gethostbyname)
Try to open SCManager of the store (OpenSCManager)
Verify if Oracle Service exists on the store (OpenService)
Verify if Oracle Service is running (QueryServiceStatus)
After all, we try to connect (ado->Open)
This procedures minimize possible errors like 0xE06D7363 when connecting to a external server.