1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Introduction to Model Context Protocol (MCP)

Connected

Bài tập

Creating Database Connections

Before wiring a database into an MCP server, you'll get some practice with creating the connection, executing parameterized queries, and closing the connections.

A database called currencies.db, containing supported currencies from the European Central Bank, is already set up and available for you to connect to.

Hướng dẫn

100 XP
  • Connect to the database file "currencies.db" and assign the connection to a variable named conn.
  • Execute the parameterized query, either with the "USD" test currency code, or with a valid code of your choosing.
  • Close the database connection.