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.
Related
I am trying to make a program that connect many computers into a local MySQL database hosted by a central computer, but the way I found to host a MySQL database is using an External program as Xampp or WampServer. I am Wodering if I can host a MySQL database using only Qt's classes like QTcpServer without the needing of external programs.
No. MySQL needs a MySQL Server process to manage connections, permissions, SQL parsing, storage engines, caching, etc. You can't use a MySQL database without a MySQL Server.
You might like to explore using SQLite, which is a free embedded database that can be used without requiring a separate daemon process. SQLite is a different product than MySQL, so there will be differences in its implementation of some SQL language features. Be sure to study the SQLite documentation: https://sqlite.org/docs.html
I did a quick Google search (my search phrase was "qt with sqlite") and I found numerous blogs and tutorials about how to use SQLite in an application with Qt. Here's just the first result, but there are others: https://katecpp.github.io/sqlite-with-qt/
I want to do simple stuff like adding entries and reading entries by index. What libraries are there and which ones are the best?
SQLite would be a good simple SQL database engine, with a simple embedded C++ interface.
SQLAPI++ would be a good choice for many commercial SQL databases (Oracle, SQL Server, DB2, Sybase, Informix, InterBase, SQLBase, MySQL, PostgreSQL, SQLite and ODBC)
One option is to use Microsoft's SQL Server Compact Edition. It is free, and has Visual Studio integration.
You can download it and find out more at the following link:
SQL Server Compact Edition
If you not worried about HUGE concurrency then use SQLite (www.sqlite.org). Download the aggregated version and you only have 2 files: sqlite3.h and sqlite3.c. It's REALLY easy to use and requires no server set up or configuration.
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.
Did I make wrong to use firebird database I don't know. It has lot's of good futures but I can't figure out why my query (stored procedure) didn't work.
Is there any profiler/monitoring tool for firebird?
Firebird database is working stand alone so it is embeded db. And It doesn't allow to connect with 2 users. If there is a profiler I wonder how it will connect while I'm executing my queries.
IBExpert and Database Worbench have stored procedure debugger
There is also many monitoring tools http://www.firebirdfaq.org/faq95/
I advice you to install server version if you want to have more than 2 users
I have a windows application in visual C++. I am not using MFC, in this application I have connect to SQL server 2005 and fetch records form a database file. Can any one guide me how this can done. Thanks in advance.
I would say, you could use some wrapper framework around the odbc calls. Currently I was working on a project where SQL server communication was involved so I found this wrapper framework: TinyODBC which is a minimalistic ODBC wrapper library. It's pretty trivial how can one use it, but I have to admit I had to patch it for a little more functionality. But otherwise it is a useful choice of ODBC communication. Now, you can use the native SQL driver via ODBC. Since it's a minimal framework, if you go through the tutorial you'll be ready to create new application with it.
Now
The complete list of accessing methods is listed here. Most popular choices for C++ programmers are SQL Server Native Client and MDAC/Windows DAC, both support OLEDB and ODBC interfaces. A comparison of SQL Server Native Client and MDAC/WIndows DAC is here.
There are other wrappers built on top of OLEDB and ODBC such as ADO or TynyODBC, which can help you to write more readable code.