skip to main content
Using the driver : Connecting from an application : Connecting Using the JDBC Driver Manager : Passing the Connection URL
  

Try DataDirect Drivers Now
Passing the Connection URL
After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The connection URL takes the form:

Connection URL Syntax

jdbc:datadirect:sforce://servername;User=username;Password=password;
SecurityToken=value[;property=value[;...]]
where:
servername
specifies the base Salesforce URL to use for logging in. The default is login.salesforce.com.
User
specifies the user name that is used to connect to the Salesforce instance.
Password
specifies the password to use to connect to your Salesforce instance. A security token may be appended to the password. See "Password" for details.
Important: Setting the password using a data source is not recommended. The data source persists all properties, including the Password property, in clear text.
SecurityToken
specifies the security token required to make a connection to a Salesforce instance that is configured for a security token. If a security token is required and you do not supply one, the driver returns an error indicating that an invalid user or password was supplied. A security token may be appended to the password. See "SecurityToken" for details.
Important: If setting the security token using a data source, be aware that the SecurityToken property, like all data source properties, is persisted in clear text.

Connection URL Example

Connection conn = DriverManager.getConnection
("jdbc:datadirect:sforce://login.salesforce.com;User=abc@defcorp.com;
Password=secret;SecurityToken=XaBARTsLZReM4Px47qPLOS");