Fri, 19 Aug 2016
Transform ODBC Data in CloverETL
CloverETL as its name suggests is an Extract, Transform, Load (ETL) application. ETL applications are mainly designed to transform and cleanse data from one source database to the format required by the target database.
CloverETL started in 2002 as an open source project that was initially made available on Freshmeat (now known as Freecode) in October of that year. CloverETL's commercial life began in 2005.
CloverETL is written in Java and uses the JDBC API to communicate with databases. If a database has a driver supporting the JDBC API, CloverETL can unload data stored within a database table, or it can populate a database table with data from another source. If a database has a driver supporting the ODBC API, a piece of middleware known as a JDBC-ODBC Bridge is needed before CloverETL can work with that database.
Java used to include a JDBC-ODBC Bridge and previously Java applications such as CloverETL could uses this bridge driver to work with ODBC databases. Now that this JDBC-ODBC Bridge has been withdrawn, a bridge driver from a commercial vendor such as Easysoft is needed.
The Easysoft JDBC-ODBC Bridge is a client server product that enables a Java application such as CloverETL to access an ODBC database such as Microsoft Access. The client part of the Easysoft JDBC-ODBC Bridge is a JDBC driver. On Windows, the sever part is a Windows service that acts as an ODBC application.
The rest of this blog documents how to use the Easysoft JDBC-ODBC Bridge to work with data from an ODBC database in CloverETL.
- Configure a System ODBC data source for the database that you want to connect to in CloverETL.
To do this, use the 32-bit version of ODBC Data Source Administrator on your CloverETL machine. On some versions of Windows, this is located in Control Panel > Administrative Tools. On some version of Windows, you need to search for ODBC in the taskbar search box. The 32-bit version of ODBC Data Source Administrator should be clearly labelled. If in doubt, in the Windows Run dialog box, type:
- Download the Easysoft JDBC-ODBC Bridge. (Registration required.)
- Install and license the Easysoft JDBC-ODBC Bridge on the machine where CloverETL is installed.
For installation instructions, see the Easysoft JDBC-ODBC Bridge documentation.
- Copy the Easysoft JDBC-ODBC Bridge client, EJOB.jar, from the Easysoft distribution to the CloverETL project's $LIBDIR folder.
- In CloverETL, in the Navigator pane, right-click conn. From the pop-up menu, choose New > Other.
The Select a wizard dialog box is displayed.
- In the Wizards list, choose Connection > Database Connection. and then choose Next.
The Database connection dialog box is displayed.
- Complete the dialog box fields:
Field Value Connection name Easysoft JDBC-ODBC Bridge User If your database requires a user name, supply it here. Password The password for
URL jdbc:easysoft://localhost/data_source:logonuser=windows_user:logonpassword=password JDBC specific Generic Available drivers easysoft.sql.jobDriver
- Choose Next, and then enter a name for the configuration file in the space provided. Choose Finish.
- In the Navigator pane, right-click graph. From the pop-up menu, choose New > ETL Graph.
The New ETL Wizard starts.
- Enter a name for the graph when prompted and then choose Finish.
- Drag a DBInputTable from the Readers Palette to the graph.
- Drag your newly created .cfg file from the Navigator palette to the DBInputTable reader.
- Double-click the DBInputTable.
The Edit component DBInputTable dialog box is displayed.
- Type an SQL Query in the space provided. Choose OK.
- In the $DATATMP_DIR folder, create a new text file.
- Drag a FlatFileWriter from the Writers Palette to the graph.
- Double-click the FlatFileWriter.
The Edit component FlatFileWriter dialog box is displayed.
- In the File URL box, use the ... button to browse for the newly created text file. Choose OK.
- Add a connector from the output of the DBInputTable to the input of the FlatFileWriter.
- Right-click the DBInputTable reader. From the pop-up menu, choose Extract Metadata.
The Metadata Wizard starts.
- In the Database schema list, choose a table. Then choose Generate Query. Choose Next.
- Choose Finish.
- Choose Run > Run to populate the text file with OBDC data.