Home » U++ Library support » U++ MT-multithreading and servers » code to more than one database and your threads
code to more than one database and your threads [message #56200] |
Mon, 08 February 2021 02:18 |
BetoValle
Messages: 203 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
Hi,
how do I adapt the server structure, to load more than one database and in different situations?
at the beginning there is only 1 database. In this situation the posted examples include. But it is assumed that in the same access create 2 other databases (all mysql) and make access etc.. along with the 1st database originally created.
how to build access with the 2 threads? how would it be?
SKYLARK(q, "qualqueres:POST")
{
//..code to create or open others databases
//..and thread(s)
}
could you give a simple example?
//first database when load server...
void OpenSQL(MySqlSession& session)
{
if(!session.Connect("user", "password", "database")) {
SKYLARKLOG("Can't connect to database");
Exit(1);
}
SQL = session;
}
void demoTeste::WorkThread()
{
MySqlSession session;
OpenSQL(session);
RunThread();
}
Thanks
|
|
|
Goto Forum:
Current Time: Tue Apr 23 22:47:14 CEST 2024
Total time taken to generate the page: 0.02304 seconds
|