<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Java code to open SSH tunnel connection? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250838#M34977</link>
    <description>Hi, does anyone here have a recommended method to using java code to open a remote ssh tunnel connection to start out a job? 
&lt;BR /&gt;To at least start somewhere I downloaded and added the latest version of jsch jsch-0.1.50.jar to my user libraries 
&lt;BR /&gt;Also found a sample script to connect here: 
&lt;A href="http://mws-mdm.blogspot.ca/2013/07/jdbc-over-ssh-tunnel.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://mws-mdm.blogspot.ca/2013/07/jdbc-over-ssh-tunnel.html&lt;/A&gt; 
&lt;BR /&gt;To get myself started I put that script verbatim into a tJava component; but it looks like the script is going to need to be Talend-ized in order to make it work. Tried it out of the box and got a number of errors: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problems: &lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.sql.Connection cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.sql.DriverManager cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.util.Properties cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Illegal modifier for the local class CTestDriver; only abstract or final is permitted&lt;BR /&gt;	The method doSshTunnel cannot be declared static; static methods can only be declared in a static or top level type&lt;BR /&gt;	JSchException cannot be resolved to a type&lt;BR /&gt;	JSch cannot be resolved to a type&lt;BR /&gt;	JSch cannot be resolved to a type&lt;BR /&gt;	Session cannot be resolved to a type&lt;BR /&gt;	Properties cannot be resolved to a type&lt;BR /&gt;	Properties cannot be resolved to a type&lt;BR /&gt;	The method main cannot be declared static; static methods can only be declared in a static or top level type&lt;BR /&gt;	The method doSshTunnel(String, String, String, int, String, int, int) from the type CTestDriver refers to the missing type JSchException&lt;BR /&gt;	Connection cannot be resolved to a type&lt;BR /&gt;	DriverManager cannot be resolved&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.tJava_1Process(TestingSSH.java:341)&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.runJobInTOS(TestingSSH.java:1308)&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.main(TestingSSH.java:1173)&lt;/PRE&gt; 
&lt;BR /&gt;Perhaps someone could help me tweak my method to get it working? 
&lt;BR /&gt;Or, perhaps someone has already gone down this path and could lay out some steps for me to follow? 
&lt;BR /&gt;Thank You 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;PS - I'm attempting to connect to a remote MySQL database</description>
    <pubDate>Sat, 16 Nov 2024 11:45:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T11:45:00Z</dc:date>
    <item>
      <title>Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250838#M34977</link>
      <description>Hi, does anyone here have a recommended method to using java code to open a remote ssh tunnel connection to start out a job? 
&lt;BR /&gt;To at least start somewhere I downloaded and added the latest version of jsch jsch-0.1.50.jar to my user libraries 
&lt;BR /&gt;Also found a sample script to connect here: 
&lt;A href="http://mws-mdm.blogspot.ca/2013/07/jdbc-over-ssh-tunnel.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://mws-mdm.blogspot.ca/2013/07/jdbc-over-ssh-tunnel.html&lt;/A&gt; 
&lt;BR /&gt;To get myself started I put that script verbatim into a tJava component; but it looks like the script is going to need to be Talend-ized in order to make it work. Tried it out of the box and got a number of errors: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in thread "main" java.lang.Error: Unresolved compilation problems: &lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.sql.Connection cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.sql.DriverManager cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	java.util.Properties cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Syntax error on token "import", assert expected&lt;BR /&gt;	com.jcraft cannot be resolved to a variable&lt;BR /&gt;	Illegal modifier for the local class CTestDriver; only abstract or final is permitted&lt;BR /&gt;	The method doSshTunnel cannot be declared static; static methods can only be declared in a static or top level type&lt;BR /&gt;	JSchException cannot be resolved to a type&lt;BR /&gt;	JSch cannot be resolved to a type&lt;BR /&gt;	JSch cannot be resolved to a type&lt;BR /&gt;	Session cannot be resolved to a type&lt;BR /&gt;	Properties cannot be resolved to a type&lt;BR /&gt;	Properties cannot be resolved to a type&lt;BR /&gt;	The method main cannot be declared static; static methods can only be declared in a static or top level type&lt;BR /&gt;	The method doSshTunnel(String, String, String, int, String, int, int) from the type CTestDriver refers to the missing type JSchException&lt;BR /&gt;	Connection cannot be resolved to a type&lt;BR /&gt;	DriverManager cannot be resolved&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.tJava_1Process(TestingSSH.java:341)&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.runJobInTOS(TestingSSH.java:1308)&lt;BR /&gt;	at natcobidw.testingssh_0_1.TestingSSH.main(TestingSSH.java:1173)&lt;/PRE&gt; 
&lt;BR /&gt;Perhaps someone could help me tweak my method to get it working? 
&lt;BR /&gt;Or, perhaps someone has already gone down this path and could lay out some steps for me to follow? 
&lt;BR /&gt;Thank You 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;PS - I'm attempting to connect to a remote MySQL database</description>
      <pubDate>Sat, 16 Nov 2024 11:45:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250838#M34977</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250839#M34978</link>
      <description>There is a user component in Talend Exchange called tSshTunnel. I would try this.</description>
      <pubDate>Thu, 13 Feb 2014 21:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250839#M34978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-13T21:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250840#M34979</link>
      <description>Hi, I started working with this component and then hit a rather strange error that I've never seen before:&lt;BR /&gt;&lt;PRE&gt;Exception in component tMysqlRow_1&lt;BR /&gt;com.mysql.jdbc.PacketTooBigException: Packet for query is too large (4739923 &amp;gt; 1048576). You can change this value on the server by setting the max_allowed_packet' variable.&lt;BR /&gt;	at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:605)&lt;BR /&gt;	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1078)&lt;BR /&gt;	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)&lt;BR /&gt;	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)&lt;BR /&gt;	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)&lt;BR /&gt;	at com.mysql.jdbc.ConnectionImpl.&amp;lt;init&amp;gt;(ConnectionImpl.java:813)&lt;BR /&gt;	at com.mysql.jdbc.JDBC4Connection.&amp;lt;init&amp;gt;(JDBC4Connection.java:47)&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;BR /&gt;	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)&lt;BR /&gt;	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;BR /&gt;	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)&lt;BR /&gt;	at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)&lt;BR /&gt; disconnected&lt;BR /&gt;	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)&lt;BR /&gt;	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)&lt;BR /&gt;	at java.sql.DriverManager.getConnection(DriverManager.java:579)&lt;BR /&gt;	at java.sql.DriverManager.getConnection(DriverManager.java:221)&lt;BR /&gt;	at ourworkspace.testingssh_0_1.TestingSSH.tMysqlRow_1Process(TestingSSH.java:703)&lt;BR /&gt;	at ourworkspace.testingssh_0_1.TestingSSH.tSshTunnel_2Process(TestingSSH.java:375)&lt;BR /&gt;	at ourworkspace.testingssh_0_1.TestingSSH.runJobInTOS(TestingSSH.java:1060)&lt;BR /&gt;	at ourworkspace.testingssh_0_1.TestingSSH.main(TestingSSH.java:925)&lt;/PRE&gt;&lt;BR /&gt;The max_allowed_packet variable was adjusted (though it's never been a problem before); I feel like this error might be bogus and something else might be going on, but I'm not sure</description>
      <pubDate>Thu, 13 Feb 2014 21:27:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250840#M34979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-13T21:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250841#M34980</link>
      <description>Did you tested the communication with a hand made tunnel?</description>
      <pubDate>Thu, 13 Feb 2014 21:34:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250841#M34980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-13T21:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250842#M34981</link>
      <description>Yes I can connect in terminal using ssh and can query successfully</description>
      <pubDate>Thu, 13 Feb 2014 21:41:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250842#M34981</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-13T21:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250843#M34982</link>
      <description>As an alternative way you could call the necessary commands to the OS by the tSystem component.</description>
      <pubDate>Fri, 14 Feb 2014 00:15:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250843#M34982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-14T00:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250844#M34983</link>
      <description>Hi thanks for the suggestion
&lt;BR /&gt;Is this the right idea for tSystem commands?
&lt;BR /&gt;1. Connect to remote server
&lt;BR /&gt;2. Start MySQL
&lt;BR /&gt;3. Enter my MySQL query
&lt;BR /&gt;Then pass the resulting data on to my next component (e.g. tMap) via Main row connector?</description>
      <pubDate>Fri, 14 Feb 2014 17:20:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250844#M34983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-14T17:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250845#M34984</link>
      <description>No I mean something like this:&lt;BR /&gt;tSystem (call the necessary ssh command) --(OnSubjobOK)--&amp;gt; tMysqlConnection --(OnSubjobOK)--&amp;gt; ... any mysql comps in flows.</description>
      <pubDate>Sat, 15 Feb 2014 15:18:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250845#M34984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-15T15:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250846#M34985</link>
      <description>Hi, Can you give more detail of how to use tSystem and tMysqlconnection or if anyone has used it can give snapshot of the settings?</description>
      <pubDate>Fri, 08 Aug 2014 18:40:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250846#M34985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-08-08T18:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250847#M34986</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;No I mean something like this:&lt;BR /&gt;tSystem (call the necessary ssh command) --(OnSubjobOK)--&amp;gt; tMysqlConnection --(OnSubjobOK)--&amp;gt; ... any mysql comps in flows.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;your fiest component is System or there is a tSSH before it?&lt;BR /&gt;I have a problem to connect to Mysql with ssh.</description>
      <pubDate>Sat, 08 Apr 2017 00:48:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250847#M34986</guid>
      <dc:creator>cacak</dc:creator>
      <dc:date>2017-04-08T00:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to open SSH tunnel connection?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250848#M34987</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;There is a user component in Talend Exchange called tSshTunnel. I would try this.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;How to configure tSSHTunnel or tSSH to connect MySql with SSH?&lt;BR /&gt;I have a problem to connect to MySql with SSH, i dont know about the command on tSSH or tSystem&lt;BR /&gt;Hope somebody can help me.</description>
      <pubDate>Sat, 08 Apr 2017 00:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Java-code-to-open-SSH-tunnel-connection/m-p/2250848#M34987</guid>
      <dc:creator>cacak</dc:creator>
      <dc:date>2017-04-08T00:51:44Z</dc:date>
    </item>
  </channel>
</rss>

