Muokkaa

Jaa


setTrustStore Method (SQLServerDataSource)

Download JDBC driver

Sets the path (including file name) to the certificate trustStore file.

Syntax

  
public void setTrustStore(java.lang.String trustStore)  

Parameters

trustStore

A String that contains the path (including file name) to the certificate trustStore file.

Remarks

If the trustStore property is unspecified or set to null, the Microsoft JDBC Driver for SQL Server will rely on the trust manager factory's look up rules to determine which certificate store to use. The default SunX509 TrustManagerFactory tries to find the trust material in the following locations in this order:

    1. A file specified by the "javax.net.ssl.trustStore" Java Virtual Machine (JVM) system property.
    1. "<java-home>/lib/security/jssecacerts" file.
    1. "<java-home>/lib/security/cacerts" file.

For more information, see the SunX509 TrustManager Interface documentation on the Sun Microsystems Web site.

If the trustStore property is set to a string or an empty string "", the driver will use that value to find the trustStore file to validate the server TLS/SSL certificate.

The trustStorePassword property can be specified along with the trustStore property and its value is used to open the trustStore file. For more information, see setTrustStorePassword.

See Also

SQLServerDataSource Members
SQLServerDataSource Class