How would I achieve a persistent database connection in C? Please help me.
By persistent database connection, we can presume for a moment you mean some persistent resource in C that a process (or many threads) can use to circumvent the overhead of creating that connection.
In short, this depends on the RDBMS, C library and method of connection. For some you might use a local IPC resource, for others you may want to keep a TCP/IP connection open.
Persisting the handle or state that allows a process to communicate with a database system depends on the database. Just remember, if the API was designed for per-process handles then you may be required to implement your own concurrency on the resource (though not necessarily the protocol) to arbitrate access to the shared handle in memory when using threads.
In short, without a specific API or RDBMS in the question, there isn't an answer. You will have to read the manual for your system.