Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在使用 Play Framework 2 制作的 Intranet 应用程序中,用户用于身份验证的凭据也可用于对数据库进行身份验证,并且发送给它的每个语句也使用此凭据。
换句话说,应用程序的每个用户都对应一个数据库用户和密码。
提前致谢。
这意味着您将无法使用连接池,而是您将创建一个按请求连接的类型,对吗?对此没有内置的支持,但自己做可能并不难。
确切的解决方案取决于您将如何访问您的数据库(Slick、ANORM 或其他?),但基本上您必须创建一些抽象来接受身份验证并创建数据库交互代码将使用的数据库会话。