Connecting MySql to C++ Project via wxWidgets

In this forum you can discuss database related issues which can be wxWidgets related, but also generic in nature.
User avatar
Inspired Child
In need of some credit
In need of some credit
Posts: 3
Joined: Wed Dec 24, 2014 6:45 pm

Connecting MySql to C++ Project via wxWidgets

Postby Inspired Child » Wed Dec 24, 2014 6:53 pm

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

User avatar
doublemax
Moderator
Moderator
Posts: 11529
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Connecting MySql to C++ Project via wxWidgets

Postby doublemax » Thu Dec 25, 2014 2:20 am

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++/
Use the source, Luke!

User avatar
Inspired Child
In need of some credit
In need of some credit
Posts: 3
Joined: Wed Dec 24, 2014 6:45 pm

Re: Connecting MySql to C++ Project via wxWidgets

Postby Inspired Child » Thu Dec 25, 2014 3:43 pm

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.

User avatar
doublemax
Moderator
Moderator
Posts: 11529
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Connecting MySql to C++ Project via wxWidgets

Postby doublemax » Thu Dec 25, 2014 3:55 pm

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.
Use the source, Luke!

User avatar
Inspired Child
In need of some credit
In need of some credit
Posts: 3
Joined: Wed Dec 24, 2014 6:45 pm

Re: Connecting MySql to C++ Project via wxWidgets

Postby Inspired Child » Thu Dec 25, 2014 4:19 pm

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


Return to “Database Related”

Who is online

Users browsing this forum: No registered users and 2 guests