Page 1 of 1

Connecting MySql to C++ Project via wxWidgets

Posted: Wed Dec 24, 2014 6:53 pm
by Inspired Child
Hi everyone!

I am new to this forum! I will be developing a desktop application soon via wxWidgets but I've been doing a lot of online research prior to the development. Primarily, I want to know how to connect MySql with wxWidgets. I want to use MySql and not the built-in DB. After setting up Codeblocks and wxWidget, how do I connect MySql to the project I'm working on? What I mean is how do I get MySql to be the database on which the application is built?

Grateful for your replies! :P

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Thu Dec 25, 2014 2:20 am
by doublemax
I want to use MySql and not the built-in DB.
What do you mean with "built-in DB"? wxWidgets has not DB built in.

In general wxWidgets has no database support, you'll need external components for that. There is "wxDatabaseLayer", but it hasn't seen any recent development.

But don't really need a wxWidgets specific component, you could just use any C++ wrapper for MySQL, e.g. MySQL++
http://tangentsoft.net/mysql++/

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Thu Dec 25, 2014 3:43 pm
by Inspired Child
Thanks for the link and response (I'll definitely read it) but please bear with me as I am also new-ish to programming as well. MySQL++ is a sub-platform of MySQL? What I mean is, does it operate just like MySQL but is more flexible with wxWidgets? If I use it when building my app, will it be the underlying database that my app will be built on? I understand what you said about wxWidgets not having a built-in DB. can I connect to MySQL++ and use it as the database? I don't understand the whole "c++ wrapper" concept that's why I'm seeking explicit explanation. I don't know what a "wrapper" is. I've read a whole lot of online material about wxWidgets and c++ but never came across "wrapper".

I hope you understand what it is I'm trying to say/ask.

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Thu Dec 25, 2014 3:55 pm
by doublemax
The basic library to connect to an MySQL database usually has a C interface which looks like this:
http://dev.mysql.com/doc/refman/5.7/en/ ... rview.html

A C++ wrapper is just a set of C++ classes that sits on top of this C interface and makes it easier to use, especially since wxWidgets is a C++ library, too.

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Thu Dec 25, 2014 4:19 pm
by Inspired Child
Double Max,

Thanks. I'll read the materials you gave me. Thanks for replying. If I have any more questions, I will ask.

Regards,
Inspired Child

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Wed May 15, 2019 3:57 pm
by steph291
I'm used to api's like OCI Oracle Call Interface,
dblib for mssql or mysql libmysqlclient-dev... all in C.
I'm pretty sure you could implement .h
and libs easily in a wxSmith project
tweak the stuff and go, try it with c calls!
:?:

Re: Connecting MySql to C++ Project via wxWidgets

Posted: Fri May 24, 2019 9:40 pm
by steph291
I'll do that this weekend !
Implement mysql calls to libmysqlclient-dev
in a GUI wxWidgets apps.

Env. : Linux Ubuntu Bionic 64b, Win7 64b
IDE : Code::Blocks
RAD : wxSmith
Comm. : tcp/ip internal network addr. range 192.168.x.x

Machine 1: win7 with mobaxterm
ssh terminal tunnelling
Machine 2 : Ubuntu Bionic having Code::Blocks
DISPLAY redirected to machine 1
Machine 3 : Ubuntu Bionic having Mysql Database engine

Busy, busy :wink: