Establishing a Connection
Creating a JDBC Data Source
You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Teradata consists of three basic steps:
- Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
- Provide the driver class. For example:
cdata.jdbc.teradata.TeradataDriver
- Provide the JDBC URL. For example:
jdbc:teradata:User=Admin;Password=test123;Database=Northwind;DataSource=127.0.0.1 or jdbc:cdata:teradata:User=Admin;Password=test123;Database=Northwind;DataSource=127.0.0.1
You can use the second format above whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:teradata:" or "jdbc:cdata:teradata:" and can include any of the connection properties in name-value pairs separated with semicolons.
Deploying the Driver
To connect using the CData JDBC Driver for Teradata, you need to add the JAR files for both the CData JDBC Driver for Teradata and the official Teradata JDBC driver to your Java classpath. For example:- cdata.jdbc.teradata.jar
- terajdbc4.jar
- tdgssconfig.jar (Only included and required for versions prior to 16.20.00.13 of the official Teradata JDBC driver)
Connecting to Teradata
The driver wraps the official Teradata Database driver. You can connect to the CData JDBC Driver for Teradata using the same connection properties, and access the same functionality, as the underlying Teradata driver.
Required Properties
To connect to Teradata, set these properties:
- AuthScheme: Specify your Teradata server's required authentication mechanism: either TD2 (default) or LDAP.
- User: Teradata user username.
- Password: Teradata user password.
- DataSource: Specify the Teradata server name, DBC Name, or TDPID.
- Port: Specify the port the server is running on.
- Database: Specify the database name. If not specified, the driver connects to the default database.