P
P
Proshka172019-10-03 15:43:45
MySQL
Proshka17, 2019-10-03 15:43:45

Why do you need MySQL Connector c++?

Good afternoon!
I installed MySQL and MySQL connector c ++ on my computer and connected it to the Visual Studio project as I read in Google, namely, I wrote mysqlcppconn.lib libmysql.lib in additional dependencies. As a result, everything works, but when I removed mysqlcppconn.lib, it still works, the question is: Why do I need MySQL connector c ++?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2019-10-03
@Mercury13

MySQL Connector C ++ is a completely different library, with a different DLL, connecting to a different MySQL port, using a different protocol, and not working with all versions of MySQL. And therefore not very necessary.
You have enabled MySQL Connector C, it works, and let it work. Just two weeks ago, I wrote my MySQL support, also through Connector C - precisely because compatibility is better. And I wrote support for C++ on my own, something like this ...

class Res
    {
    public:
        Res() = default;
        Res(MYSQL_RES* x) : fD(x) {}
        Res(const Res&) = delete;
        Res(Res&& x) { operator = (std::move(x)); }
        Res& operator = (const Res& x) = delete;
        Res& operator = (Res&& x);

        ~Res() { close(); }

        const MYSQL_RES& d() { return *fD; }
        void close();
        bool next();
        std::wstring tableName() const;
        const char* at(size_t i) const { return fRw[i]; }
    private:
        MYSQL_RES* fD = nullptr;
        MYSQL_ROW fRw = nullptr;
    };

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question