Components show
Name:
PostgreSQLDataWriter
Description:
Receives data through connected input port or reads it from input file, connects to PostgreSQL database using psql utility and loads data records into specified database table. It works faster than DBOutputTable.
How to Import and Run Examples
Preliminares
Complete documentation to CloverETL.
Detailed examples description.
You can work with downloaded CloverExamples zip file using CloverETL Engine. This will be described second.
However, CloverExamples zip file contains complete Eclipse project, so if you use CloverETL Designer you can import it to your workspace. This will be described last.
Import CloverExamples to CloverETL Designer
Option 1
When you download any version of CloverETL Designer plugin, you can also download CloverETL Examples plugin. We suggest you do that.
After installing CloverETL Designer along with CloverETL Examples plugin, the absolute simplest way how you can import CloverETL examples to CloverETL Designer is to select File -> New -> Project... from the main menu.
In the wizard that opens, expand the CloverETL category, select the CloverETL Examples Project item, click Next, choose the projects you want to import to your workspace by checking the checkboxes and click Finish. After that, all will be done and set automatically except changes of connection configuration files contained in the conn subdirectory of the ExtExamples project. (Before CloverETL Engine 2.7.0, it was the extExamples project.) That must be done by hand. Then you can run CloverETL examples using standard Eclipse mechanism.
You can decide which examples you want to import. The following screenshot shows a list of projects included in the latest release of CloverETL Designer (2.2.1). Remember that the CommercialExamples project is only available with CloverETL Designer.
Option 2
However, if you want to work with some older examples (provided as zip files), what is quite possible, you need to import them in another way. To import them, you cannot do the same what has been described as the Option1 above. Now you should use the Import... option from the main menu or the context menu instead.
Step 1
First, you need to download CloverExamples from our site. Then, import these examples to CloverETL Designer from its main menu. Select File -> Import....
The same can be done by right-clicking in the Navigator pane and selecting Import... from the context menu.
Step 2
After that, the Import wizard opens. Expand the CloverETL category, select the Import external CloverETL projects item and click Next.
Step 3
A new page of the Import wizard opens.
I. If the CloverExamples file have not been unzipped
If you have downloaded the binary CloverETLExample zip file, but have not unzipped it, switch the radiobutton to Select archive file. When you locate the zip file containing examples, the list of examples projects contained in the examples zip file appears in the Projects pane along with checkboxes. By checking the checkboxes, choose which projects you want to import to your workspace and click Finish.
After that, delete the workspace.prm file within the project directory in the Navigator pane and rename the workspace.prm.tmp file to the new name: workspace.prm. In this file, the PROJECT parameter has been set automatically to its correct yourpathtoworkspace/nameoftheprojectvalue. The name of the project is the name of the directory containing the workspace.prm file.
Then, you only need to configure some connection configuration files contained in the conn subdirectory of your project and you can run any example graph using standard Eclipse mechanism.
II. If CloverETL Examples file have been unzipped
If you have downloaded the binary CloverExample zip file and have unzipped the file, switch the radiobutton to Select root directory. When you locate the unzipped examples directory, the list of examples projects contained in the unzipped examples file appears in the Projects pane along with checkboxes. By checking the checkboxes, choose which projects you want to import to your workspace.
Then, you can also decide whether you want to copy the selected projects into your workspace, or link them to the workspace only. If you want to copy them to the workspace, leave the Copy projects into workspace checkbox checked. Otherwise, uncheck it. In such a case, the projects will only be linked to the workspace. At the end, click Finish.
After that, delete the workspace.prm file within the project directory in the Navigator pane and rename the workspace.prm.tmp file to the new name: workspace.prm. In this file, the PROJECT parameter has been set automatically to its correct yourpathtoworkspace/nameoftheprojectvalue. The name of the project is the name of the directory containing the workspace.prm file.
Then, you only need to configure some connection configuration files contained in the conn subdirectory of your project and you can run any example graph using standard Eclipse mechanism.
Working with CloverExamples using CloverEngine
We assume that you have downloaded a binary package of CloverETL Engine from our site or you have built it from sources downloaded from the same site. Unzip the file to some location. Then, you will have CloverETL Engine in some yourpath/CloverETL directory. This directory will contain the following four subdirectories: bin, docs, lib, and plugins.
After that, download CloverExamples from our site. Unzip the file to the yourpath/CloverETL/examples directory. In the latest CloverExamples, you have the following six important subdirectories: AdvancedExamples, CompanyTransactionsTutorial, CTLFunctionsTutorial, ExtExamples, JavaExamples, and SimpleExamples. Each of them contains a workspace.prm file. The directories containing a workspace.prm file are Clover projects. Thus, the mentioned AdvancedExamples, CompanyTransactionsTutorial, CTLFunctionsTutorial, ExtExamples, JavaExamples or SimpleEaxmples directories are Clover projects.
In any workspace.prm file, some parameters that will be used by CloverETL Engine are defined. The most important is the PROJECT parameter. The others parameters specified in this file are defined using this PROJECT parameter. You must set the PROJECT parameter of any Clover project to its correct value.
Each project directory contains the following subdirectories: conn (for connections to database), data-in (for input files), data-out (for output files), data-tmp (for temporary files), graph (for proper graphs), lookup (for lookup tables), meta (for metadata definition files), seq (for sequences), and trans (for transformations written in Java or Clover transformation language).
To run graphs of some Clover project, set the PROJECT parameter to yourpath/CloverETL/examples/nameoftheproject value.
For example, if you set the PROJECT parameter contained in the workspace.prm file in the yourpath/CloverETL/examples/SimpleExamples directory (in other words, that of the Clover project named SimpleExamples), set the PROJECT parameter to yourpath/CloverETL/examples/SimpleExamples value.
And, you must also change the connection configuration files contained in the conn subdirectory of ExtExamples project.
In addition to it, you need to add some required libraries to your CLASSPATH. You can set CLASSPATH for your system or you can type the list of required libraries directly in the command.
At least, the following jar-s must be added to CLASSPATH: cloveretl.engine.jar, commons-logging.jar, log4j-1.2.12.jar, and javolution.jar. They are all contained in the yourpath/CloverETL/lib directory.
Sometimes you also need to add some other libraries to CLASSPATH. The reason is that some graphs use transformations written in Java. For them, you should add the tools.jar file of your JRE to CLASSPATH too.
Remember that you should use Java 1.5 or higher to run the example graphs!
Thus, to run any graph, switch to corresponding project (in other words, to the directory containing a workspace.prm file) and type in the command line the following:
java -cp "../../lib/cloveretl.engine.jar:../../lib/commons-logging.jar:../../lib/log4j-1.2.12.jar:../../lib/javolution.jar" org.jetel.main.runGraph -plugins ../../plugins graph/nameofthegraph.grf
For example, if you want to run graphSimpleCopy.grf of the SimpleExamples project, switch to the yourpath/CloverETL/examples/SimpleExamples directory and type:
java -cp "../../lib/cloveretl.engine.jar:../../lib/commons-logging.jar:../../lib/log4j-1.2.12.jar:../../lib/javolution.jar" -plugins ../../plugins org.jetel.main.runGraph -plugins ../../plugins graph/graphSimpleCopy.grf
If you want to run the graphs of other projects, switch to their directoris and type similar commands.
And, if you need to run some graph that uses a Java transformation, add to CLASSPATH also the following expression: yourpathtoJRE/lib/tools.jar. In such a case, you would have the following command:
java -cp "../../lib/cloveretl.engine.jar:../../lib/commons-logging.jar:../../lib/log4j-1.2.12.jar:../../lib/javolution.jar:yourpathtoJRE/lib/tools.jar" org.jetel.main.runGraph -plugins ../../plugins graph/nameofthegraph.grf
If you also want to specify some program arguments (see their list in the Command line section of the wiki page), type their before the graph name as shown below for -loglevel:
java -cp "../../lib/cloveretl.engine.jar:../../lib/commons-logging.jar:../../lib/log4j-1.2.12.jar:../../lib/javolution.jar:yourpathtoJRE/lib/tools.jar" org.jetel.main.runGraph -plugins ../../plugins -loglevel INFO graph/nameofthegraph.grf
Important Note for Windows Users
Remember that what has beed said is valid for Unix systems and, if you work on Windows, you must use semicolon (;) as delimiter of CLASSPATH elements instead of colon (:).
Important Note Concerning Older Examples
The directory structure of older examples and their names were different from those of newer ones. They even were one project named examples instead of six internal projects contained in the examples envelope as it is now.
The workspace.prm was only one and was stored in the examples directory. Thus, to run such older examples, you need to switch to this yourpath/examples directory and use similar command like the mentioned above with only one change. You should replace the following parts of the command (../../) by others (../).