I've a c++ application with connects to mysql database, creates table and adds some data into it using the mysql connector library.
The question is following :
I would like pack my application so for using the the installation of mysql were not required.
Is it possible to do at all ? If yet any hints, references are welcomed.
The application is managed c++ based.
Yes, MySQL provides an embedded, in-process version that doesn't require you to install a separate MySQL server and yet provides pretty much the same functionality.
Note however that this is subject to license restrictions: you can either use it under a GPL license (and thus you must publish your application's source code if you ever redistribute it to a third-party) or under a commercial license (which you have to pay for, if you want to redistribute your application but not license it under GPL).
I think there is a way. Have a look at one of my SO questions - How can I explore mysql database files (*.frm, *.myd and *.myi) without MySQL? I am also the one who answered it.
It gives you a hint on how you can carry the MySQL DB engine with you, provided you have successfully dealt with the licensing.
Related
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).
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.
I am supporting development servers for 35+ versions of the product. Each version may not have same DB schema so traditionally we have to support Oracle instance for each version for the developers to build the Pro*C libraries.
Now the number of versions are too many to support with individual DB instances on individual Linux servers. So I was wondering either of these approaches are possible.
1) To compile Pro*C code (.pc .pcc) without semantic check (I know it's dangerous for release build but for quick test builds, developers don't need to wait for me to provide them a new server)
2) Have one server with 35+ instances of database, containing only meta data
I searched quite a few places if I can disable semantic check but no success. I tried to configure multiple instances on one Linux server but each instance uses quite a lot memory so having 35+ instances is out of question.
Any clever tricks and suggestions are much appreciated.
Thanks,
Tyn
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!
I am struggling to connect to oracle db using GNU C++.Is there any library which I have to install to connect to oracle db using simple c++ (oops).
Please provide me some sample code as well, this is new for me. Appreciate your help.
I asked a similar question before but forgot to mention that I am not using vc++ and proc.
You would need the oracle C++ libraries (OCCI) from oracle. You can find them here:
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Google "Oracle OCCI tutorial" and you should find pretty much everything you need.
Check out SOCI. It supports several database backends, including Oracle, MySQL, Postgre, ODBC, etc. Using this library would make it easier for you to migrate your application to a different DB, if necessary.
There's a code sample here. And several more peppered in the documentation.