Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have requirement wherein I have to capture Talend username in a String variable / input_row(tJavaRow) which will be passed further in a table (Mysql) for logging purpose, to identify job was executed from whose machine.
Any idea on how we can achieve this in Talend?
In your tJavaRow code you could put either of the code block to get the current Windows User Name -
String userName = System.getProperty("user.name"); System.out.println(userName); com.sun.security.auth.module.NTSystem NTSystem = new com.sun.security.auth.module.NTSystem(); userName = NTSystem.getName(); System.out.println(userName);
In your tJavaRow code you could put either of the code block to get the current Windows User Name -
String userName = System.getProperty("user.name"); System.out.println(userName); com.sun.security.auth.module.NTSystem NTSystem = new com.sun.security.auth.module.NTSystem(); userName = NTSystem.getName(); System.out.println(userName);