Thanks for explaining that. Now I understand. Unfortunately, you cannot publish (and hence cannot embed) a notebook with a database connection. See DB Connections + Public Notebooks? where one option is to use Splitgraph…
Another recommendation is to create your own proxy server for the database as described above by @hellonearthis .