What is Connection String?
A formatted string containing all parameters needed to establish a connection to a database server.
Connection strings specify the database driver, host, port, database name, username, password, and options. PostgreSQL format: postgresql://user:password@host:5432/dbname?sslmode=require.
Best practices include storing connection strings in environment variables (never in code), using SSL/TLS for encrypted connections, connection pooling, and using separate credentials per environment. Some frameworks accept individual parameters instead of a single string.