connection string for PostgreSql
时间:2011-05-26 来源:逗号李
http://www.mono-project.com/PostgreSQL#Some_Connection_Example
Parameter Definition | Description | Example |
---|---|---|
Server | hostname of the PostgreSQL Server | Server=localhost |
Database | name of the database | Database=postgres |
Port | Network port to connect. Optional | Port=54321 |
User ID | user id | User ID=postgres |
Password | password | Password=mypass12 |
Encoding | Encoding to be used. Possible values: ASCII(default) and UNICODE. Use UNICODE if you are getting problems with UTF-8 values | Encoding=UNICODE |
SSL | True or False. Controls whether to attempt a secure connection. Default = False | SSL=true |
Pooling | True or False. Controls whether connection pooling is used. Default = True | Pooling=false |
MinPoolSize | Min size of connection pool. Default: 1 | MinPoolSize=2 |
MaxPoolSize | Max size of connection pool. Default: 20 | MaxPoolSize=6 |
Timeout | Time to wait for connection open in seconds | Timeout=30 |
Sslmode |
Mode for ssl connection control. Sslmode can be one of the following values:
Prefer - If it is possible to connect using ssl, it will be used. Require - If an ssl connection cannot be made, an exception is thrown. Allow - Not supported yet, just connects without ssl. Disable - No ssl connection is done. Default is Disable. |
Sslmode=Require |
Protocol | Protocol version to use, instead of automatic detection. First tries 3 and fallsback to 2; Integer 2 or 3. | Protocol=2 |
CommandTimeout=20;Timeout=15;
相关阅读 更多 +