Using SQuirrel SQL Client with Teradata
Teradata offers many ways to connect and query our database with our Tools and Utilities(TTU) package - BTEQ, BTEQWin, SQLA and the TD Eclipse plug-in.
These are great tools and we're here to promote them and help you get the most from them. But we're techies too and we understand that there are times when you want to use your own tool of choice. We get it and we're here to help you with this option as well.
Let's take SQuirrel as an example. This is a great, popular SQL client tool and yes, it plays well with Teradata. Here's a quick start-up guide to get you running your Teradata queries with it in no time.
What do we need?
- If you haven't installed SQuirrel yet, you can get it from their website: http://squirrel-sql.sourceforge.net.
- If you need a Teradata database for your development, install our Teradata Express edition: http://developer.teradata.com/tools/articles/teradata-express-edition-12-0, otherwise we just need your account and connection information.
- And finally, download the latest Teradata JDBC driver here: http://developer.teradata.com/download/connectivity/teradata-jdbc-driver-13-0-0-6
Installing Teradata's JDBC driver.
The Teradata JDBC package can be downloaded as either a ZIP file or a TAR file. Basically it's 2 jar files that you need to put into your classpath:
In this example, I created a new folder, "c:\Program Files\Java\myjars", extracted the files to this folder and finally updated my classpath environment to include both jar files explicitly.
Be sure to update your classpath before starting up SQuirrel to ensure that the new path environment is being used.
Configuring SQuirrel for Teradata
Start up SQuirrel and click on the Drivers tab along the left edge.
This lists all the database connectivity options currently configured and available. What we want to do is add our Teradata JDBC driver, so go ahead and click the green PLUS icon.
Scrolling to the bottom of the list of drivers should display our Teradata jar files in our Java classpath. I've added some default values here as well that can be used for a local TD Express installation.
Click OK and you should see a green success message at the bottom of the window.
Now click on the Aliases tab on the left edge. Creating an Alias is where we'll add your username/password parameters in order to connect to the database. Once again, click the green PLUS icon.
I've named this Alias "Teradata local", used the same JDBC url as my connection string and also the TD Express default user, tduser (and tduser as the password - shhh!).
You should now be able to click the Connect icon to establish a session with Teradata and start browsing your database objects. Here's a screen shot with the TD Express sample objects:
Here's the output from everyone's favorite query:
SELECT Name, Salary FROM retail.Employee WHERE Salary > 100000 ORDER BY Salary DESC
That's it. SQuirrel is now configured to connect to Teradata and we have a nice tool for browsing the database objects and running queries.
Have fun and go nuts!