Where to find connect declaration of this mysql instace
-
Yes, but I don't know where to find the definition of this method. I don't find the code behind it.
-
That is the definition of the method. You just need to code it with all the parameters filled in as necessary.
I don't see where I am misunderstand the things but it appears to me as a declaration of a method. For example if we have a class defined like that:
class point{
public:
int x,y;
void set (int val_x, int val_y); // here the method declaration
};void point::set( int val_x, int val_y) // here the method definition
x = val\_x; y = val\_y;
}
void main()
{
point p1;p1.set(10,2); // here te call of the method
}
In the set method I have the parameters val_x and val_y, and I see in the definition of the set method the processes that implies val_x, and val_y, I see that val_x is attributed to x and so over, but in the connect method I don't see where hostName, userName and password are used. That it what I want to understand. Thank you,
-
I don't see where I am misunderstand the things but it appears to me as a declaration of a method. For example if we have a class defined like that:
class point{
public:
int x,y;
void set (int val_x, int val_y); // here the method declaration
};void point::set( int val_x, int val_y) // here the method definition
x = val\_x; y = val\_y;
}
void main()
{
point p1;p1.set(10,2); // here te call of the method
}
In the set method I have the parameters val_x and val_y, and I see in the definition of the set method the processes that implies val_x, and val_y, I see that val_x is attributed to x and so over, but in the connect method I don't see where hostName, userName and password are used. That it what I want to understand. Thank you,
coco243 wrote:
in the connect method I don't see where hostName, userName and password are used.
Why do you need to? All you really need to understand is that the C++ library will use those details to create an actual connection to the MySQL driver, and from there to the actual database server.
-
Yes, I have installed Connector C++ 8.0, in the link below it is explained that Conector C++ 8.0 supports "legacy C++ API based on the JDBC4", and there is an exemplified code where appear the "connect" statement, and I am not able to understand where is defined to see it's functions or more details. https://dev.mysql.com/doc/dev/connector-cpp/8.0/jdbc\_ref.html Thank you.
The legacy API documentation is in Connector/C++ 1.1 Developer Guide[^] even if you use version 8 of the connector. Options for
MySQLDriver::Connect()
are explained here: https://dev.mysql.com/doc/connector-cpp/1.1/en/connector-cpp-connect-options.html[^] -
coco243 wrote:
in the connect method I don't see where hostName, userName and password are used.
Why do you need to? All you really need to understand is that the C++ library will use those details to create an actual connection to the MySQL driver, and from there to the actual database server.
-
The legacy API documentation is in Connector/C++ 1.1 Developer Guide[^] even if you use version 8 of the connector. Options for
MySQLDriver::Connect()
are explained here: https://dev.mysql.com/doc/connector-cpp/1.1/en/connector-cpp-connect-options.html[^] -
I had figured that if I know how this function is defined, I can extract more information about the conection, status of conection and other things that I am not aware, in addition I wanted to have a better overview on the subject.
All such information would normally be found in the documentation. And after searching the MySQL pages I think you need to look at https://dev.mysql.com/doc/c-api/8.0/en/[^]. it is titled "C APIO", but I assume it works just as well with the C++ driver.
-
All such information would normally be found in the documentation. And after searching the MySQL pages I think you need to look at https://dev.mysql.com/doc/c-api/8.0/en/[^]. it is titled "C APIO", but I assume it works just as well with the C++ driver.
Normaly this information should be in the installation folders of the C++ connector, in the headers files, and some of it, it is, but I just don' t know where to find definition of those methods, any way I supose that I will succed finally, but it would have been intresting to know how this method were coded. Or maybe those would be an waste of time or to complicate for my knowledge level.
-
Normaly this information should be in the installation folders of the C++ connector, in the headers files, and some of it, it is, but I just don' t know where to find definition of those methods, any way I supose that I will succed finally, but it would have been intresting to know how this method were coded. Or maybe those would be an waste of time or to complicate for my knowledge level.