Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Returns a reference to this SQLServerDataSource object.
public javax.naming.Reference getReference()
A Reference object.
This getReference method is specified by the getReference method in the javax.naming.Referenceable interface.
Prior to SQL Server JDBC Driver 3.0, if SQLServerDataSource.setTrustStorePassword was called on a SQLServerDataSource object, the password would be present in the object returned by SQLServerDataSource.getReference, allowing the object to be used to make additional connections. In JDBC Driver 3.0, you will need to set the password on the object returned by SQLServerDataSource.getReference before you make connections with the object.
Also, if you set SQLServerDataSource.setTrustStorePassword before binding the data source properties, you must call SQLServerDataSource.setTrustStorePassword before getting the connection. For example,
ctx = new InitialContext(System.getProperties());
SQLServerDataSource ds1 = (SQLServerDataSource) ctx.lookup(jndiName);
ds1.setTrustStorePassword("XXXXX");
Connection con = ds1.getConnection("user", "XXXXXX");
ctx.rebind(jndiName, ds1);
SQLServerDataSource ds2 = (SQLServerDataSource) ctx.lookup(jndiName);
ds2.setTrustStorePassword("XXXXX"); // reset the truststore password
con = ds2.getConnection("user", "XXXXXX"); // provide userid and password again
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today