Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

About - tSystem

Hi,
I am trying to execute command using "tSystem" component.I am using only one componet. In properties I have typed "echo Talend is a good tool". When I execute this, I am getting following error.

connecting to socket on port 4068
connected
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
disconnected
Invalid character constant

Can any body help?
Labels (3)
10 Replies
Anonymous
Not applicable
Author

Hi rajendhar47
You should typed "cmd /c echo Talend is a good tool" and it will run fine.
Best regards
shong
Anonymous
Not applicable
Author

Thanks, it is working.
Can any body tell me how to call a batch file through tSystem.
c0utta
Creator
Creator

Hi rajendhar47,
You call it the same way that shong has specified, "cmd /c batchfile.bat". "cmd /c" runs the command shell of the OS, runs batchfile.bat, and then terminates.
It might help to spawn a command shell and type "cmd /?" to see a full list of the syntax. One thing that may trip you up is the relative location of where the batchfile will be executed - I always put a "cd\" (change directory) as the first statement in my batch files.
Cheers,
c0utta
Anonymous
Not applicable
Author

Hi,
I'm trying to use the Tsystem component on a windows system to read a key in the key registery. In my windows console I don't have any problem but talend return to me
Error unvalide keyname
My shell script is
"cmd /c reg query \"hkcu/software/PDFCreator/Program\" /v AutosaveFilename"
cheers,
cahsohtoa
Anonymous
Not applicable
Author

Hello,
REG QUERY doesn't accept /
Replace
"cmd /c reg query \"hkcu/software/PDFCreator/Program\" /v AutosaveFilename"
by
"cmd /c reg query hkcu\\software\\PDFCreator\\Program /v AutosaveFilename"
Regards,
Anonymous
Not applicable
Author

It works!!!
thank you very much for your help
_AnonymousUser
Specialist III
Specialist III

hello
I want to use a job with these component: File.xls >>>>tsystem>>>tuniqrow>>>>OutDB.
I wrote a java code which enable me to extract cells from excelfile and put it in a tablemysql.
This is the code:
import jxl.*;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

//import jxl.Cell;
//import jxl.Sheet;
//import jxl.Workbook;
import jxl.READ.biff.*;
//import jxl.READ.biff.BiffException;

public class Finalimport {

public static Connection conn=NULL;
PreparedStatement pst=NULL;


public Finalimport() throws BiffException, IOException{
Workbook WbFichier= Workbook.getWorkbook(new File("C:\\Documents and Settings\\mariem.essaies.stg\\Bureau\\DAILY REPORT\\7_sgsn subs.xls"));
//ouverture de la 1ère feuille
Sheet shtFeuille = WbFichier.getSheet(0);

int nmax = shtFeuille.getColumns();
//super();
//Connection con=NULL;
try{
Class.forName("com.mysql.jdbc.Driver");

String url="jdbc:mysql://localhost/datamartgprs";

String login="root";

String password="123";

conn=DriverManager.getConnection(url,login,password);
String q = "insert into D_KPI (nom_kpi) values(?)";
//String q = "insert into dkpi values(?)";
pst=conn.prepareStatement(q);
// String j="1";
FOR( int i=3; i<nmax; i++) {

//Recuperation de la valeur d'une cellule
Cell cel01 = shtFeuille.getCell(i,3);
//Cell cel01 = shtFeuille.getCell("D4");
String kpi = cel01.getContents();
//Cell cel02 = shtFeuille.getCell("B1");

//if (cel01.getType()== CellType.DATE){
//System.out.println(j);
//pst.setString(1,j);
System.out.println(kpi);
pst.setString(1,kpi);
//int s = Integer.parseInt(j);
//s=s+1;
//j=(new Integer(s)).toString();

int val = pst.executeUpdate();


}
//j=(new Integer(s)).toString();

// System.out.println("Connexion etablie");
}
catch (Exception e){
e.printStackTrace();

System.out.println("Connexion échouée!!!");


}


//Class.forName("com.mysql.jdbc.Driver");
//con=DriverManager.getConnection("jdbc:mysql://localhost/cdm?user=root&password=");
//String q = "insert into masterdata values(null,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";

// TODO Auto-generated constructor stub
//ouverture du fichier

}
public static void main(String[] args)throws BiffException, IOException {
// TODO Auto-generated method stub
Finalimport impo= new Finalimport();
}

//}
}

/**
* @param args
* @throws IOException
* @throws BiffException
*/

How can I change this code if I want to make it work on Talend with every component in entry and every table outmysql.
I should wrote this in my tsysyem :
cd C:\Program Files\Java\jdk1.6.0_10\bin
javac Finalimport.java
java Finalimport
Please, how can I do this?
Thanks.
_AnonymousUser
Specialist III
Specialist III

hello
to simplify what i have written before, I tried to put 3 component tsystem with a tlogRow:
tsystem ("cmd /c")>>>>tsystem("cd C:\\Program Files\\Java\\jdk1.6.0_10\\bin")>>>tsystem ("java Finalimport") >>tLogRow
I have always this error message that show me cd is not reconized as a command .
How can I write these 3 command on only one tsystem component? Please, help me to resolve this problem. Thanks.
Anonymous
Not applicable
Author

Apart of your error, honestly with such custom coding you are quite invalidating the reason to use an ETL tool like Talend that has the ability to seamlessly import and process excel files...
that said, "cd" is not a command in windows, but a builtin function of the command processor cmd.exe... you can't invoke it directly.
Also "cmd /c cd" isn't going to work because the "current dir" doesn't persist between shell calls...
Just write a .bat or .cmd script file with the commands you want and use just one tsystem to invoke such script.