In this recipe, we will guide you through the steps required to connect to your MongoDB instance via the JDBC-based SQuirreL SQL Client. We will be using the Thin Kettle JDBC Driver to make the connection to the MongoDB instance.
The SQuirreL SQL Client is a SQL client open source project, and it is possible to connect to any database that provides a JDBC driver, such as Thin Kettle.
To get ready for this recipe, you first need to start the MongoDB server with the same database as that of the last chapter. Then make sure that the Carte and DI servers are running. Download SQL Squirrel from http://squirrel-sql.sourceforge.net and install it in your computer by following the instructions on the website.
Once we have our Carte or DI Server up and running, we can configure a SQL client to fire some SQL queries and get some data back. Perform the following steps to configure a Squirrel SQL client:
Kettle Thin
.jdbc:pdi://<server:port>/kettle?<option=value>
.<pentaho-installation-path>/design-tools/data-integration/lib
folder:kettle-core-<version>.jar
kettle-engine-<version>.jar
commons-httpclient-3.1.jar
commons-codec-1.5.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
commons-vfs-<version>-pentaho.jar
log4j-1.2.16.jar
scannotation-1.0.2.jar
Pentaho Carte Server Conn
.jdbc:pdi://localhost:8082/kettle
.cluster
.With the connection defined, you can now connect to Carte using your Thin Kettle connection. Double-click on the Pentaho Carte Server Conn connection and click on the Connect button. You will have a new session tab opened, as shown in the following screenshot. In this session, you can execute basic operations such as running SQL queries, listing tables, and listing columns of a particular table.
select * from AggregationTable
, in the text area.admin
and password
, respectively.The driver is registered in SQuirreL using a set of Java libraries. The kettle-core-<version>.jar
file is the main library that is used to create the connection, and it contains the org.pentaho.di.core.jdbc.ThinDriver
class. The other .jar
files are dependencies of the kettle library. These Java libraries are required to make the connection to the Carte or DI server and execute the SQL queries that we described before. Think of the Carte or DI Server as the "Kettle Database."
This recipe uses the Squirrel SQL Client as an example. However, you can use some other SQL client and develop a solution using this JDBC or using any reporting solution that is JDBC-based.
The Thin Kettle JDBC Driver is limited to only performing select queries. It does not have the ability to execute inserts, updates, deletes, and so on. With the select
ability, we can support connections to Mondrian. Mondrian is a ROLAP (short for Relational Online Analytical Processing) server used by the Pentaho BA server, which we will cover in more detail in the next couple of chapters.
If you want to learn more about what SQL is supported by the Thin Kettle JDBC Driver, you can consult this documentation website:
http://wiki.pentaho.com/display/EAI/JDBC+and+SQL+Reference#JDBCandSQLReference-SQLSupport