Hello and welcome to the golden programming language course in the previous session.
We could define a database layer.
And in this session, we want to establish the communication between geographies on the database.
Now it's time to design, to serve our part.
First, go to explore and create a project folder like name server create project on the server.
And crude often can't service controller.
Me fine.
Service
controller that grew.
Here, Yvonne, to implement different parts related to G.R. PC service, to be able to communicate
with the metals in the database.
Create distraught and inside it.
Recreate the field from the DB, initialize the racetrack of the DV tools package.
And in this way, we establish the connection between the database layer and G.R. PC layer.
So we right?
First package, Serbia and Tie sit a name for a strike like she are PC controller destruct
define a variable by the type of DB initial laser, for example DB connection from asterisk DB tools
DB initial laser.
We now have access to the components needed to use the database.
You need to initialize the connection fields so that you can use it to connect to the metals in the
database.
To do this, we need to calm the iconic metal from the DevTools package.
The return value of this metal is another object from the deep initialize restaurant, and using it,
we can set the TV connection, fill in the GRB controller extract.
Now we go to create the function and implements this.
So the right phone set the name for function like job is the service initialize our G, our PC server
initialize the.
And set to require parameters for using conic function to create a connection to the database first,
its driver name and second is data source name, driver name, history and data source name is Streak.
This function is supposed to return to values for us first anarchic from GOP controllers strike and
the other is an error object.
So we say the pointer of the controller
asterisk g, our PC controller.
And sit and a little.
Now go to implements the body of function.
It's time to call connect function from debate tools package.
First, define two variable life dividend a rule.
The B and rule calling equals the B tools that connect.
Sit driver name
and said it a source name.
Check our status.
If you're not equals, need
greater need and you're all.
And return and the object from G.P.S. controller is right and initialized, deep connection field of
eat by debris field created from Colin cunning function of DevTools package so we could initialize DB
connection field for using in this package.
So we'll be right return.
And for some.
Dear PC controller and initialize the.
Connection by theory and set the format the called and save the project.
Now we could create a function named G.P.S. server initialization if we call the G.R. PC server initialize
a function by initializing its input parameters.
We can initialize the DB connection field of the G.R. PC controller struct and using it, we will have
access to the database methods to prepare for the operation by G.R., PC, etc. In order not to prolong
the time of the session, we will finish.
She then will continue the content in the next session.
Goodbye.