Did child need those or any other file descriptors from parents at all ?
If not - and assuming your are using Linux (who use something else for servers anyway
you can instead of fork use clone with flag CLONE_FILES turn off
In this case parent and child will not share file descriptors.
If child really uses some file descriptors from parent, then turning of CLONE_FILES is not an option.
In this case you can write small shared libraries and run your child process with this libraries LD_PRELOADed.
Shared library should implement 'close' function. Those function should do nothing for
network connection and database connection file descriptors and behaves like original close for any other