Specifying Connection Properties
You can specify connection properties using a connection URL, the JDBC Driver Manager, or JDBC data sources. For a list of the connection properties, see JDBC Connection Properties.
Using the Connection URL
The following example shows a typical SuiteAnalytics Connect JDBC driver connection URL:
jdbc:ns://<ServiceHost>:1708;ServerDataSource=NetSuite2.com;Encrypted=1;NegotiateSSLClose=false;CustomProperties=(AccountID=<accountID>;RoleID=<roleID>);
The <ServiceHost>, <accountID>, and <roleID> variables correspond to your host name, account ID, and role ID. The values are available on the SuiteAnalytics Connect Driver Download page under Your Configuration. You can access the SuiteAnalytics Connect Driver Download page using the Set Up Analytics Connect link in the Settings portlet when you are logged in to NetSuite. For more information, see Finding Your Settings Portlet.
The user and password connection properties are not shown. These properties are usually specified in the connection properties stored in the java.util.Properties object. Alternatively, they can be supplied as parameters to the getConnection() method.
The connection properties used in this connection URL correspond to the following fields on the SuiteAnalytics Connect Driver Download page under Your Configuration.
Field |
Connection Property |
---|---|
Service Host |
ServerName |
Service Port |
PortNumber |
Service Data Source |
ServerDataSource |
Account ID |
CustomProperties (AccountID) |
Role ID |
CustomProperties (RoleID) |
For examples of connection URLs, see Connection URL Used with JDBC Driver Manager Example.
Using the JDBC Driver Manager
In order of precedence, you can specify connection properties using:
-
getConnection(url, user, password), where user and password are specified using the getConnection method defined in java.sql.DriverManager.
DriverManager.getConnection(connectionURL, user, password);
-
java.util.properties object.
DriverManager.getConnection(connectionURL, (java.util.Properties) properties);
-
Connection URL specified using the URL parameter of the getConnection method defined in java.sql.DriverManager.
DriverManager.getConnection(connectionURL)
For details, see JDBC Code Examples.
Using JDBC Data Sources
In order of precedence, you can specify connection properties using:
-
getConnection(user, password), where user and password are specified using the getConnection method defined in javax.sql.DataSource.
getConnection("test@netsuite.com", "<password>")
-
JDBC DataSource object.
For details, see JDBC Data Source Example.