Is it a good way to use system() for database scripts from C?

后端 未结 3 2122
耶瑟儿~
耶瑟儿~ 2021-01-05 13:06

I was searching for connecting to database from C program. But I thought the ODBC connections, logon and all need some libraries. Also I am having a minimal compiler like Ti

3条回答
  •  忘掉有多难
    2021-01-05 13:54

    I wouldn't recommend this if your calling code is running setuid or setgid, but in that case you could use one of the exec() functions instead. (There are a few other considerations you may wish to take into account, all detailed in man 3 system.)

提交回复
热议问题