Arigato Yamanaka-san! That worked perfectly...

On Wed, 2 May 2012, Atsuhiko Yamanaka wrote:

> Hi,
>
>   +-From: "Benjamin L. May" <bl...@columbia.edu> --
>   |_Date: Tue, 1 May 2012 11:29:57 -0400 (EDT) ____
>   |
>   |I am attempting to do the following:
>   |My local hostname is nine.cpmc.columbia.edu
>   |The MySQL server to which I am attempting to connect is on
>   |gem.cumc.columbia.edu
>   |I am attempting to SSH through an intermediary server
>   |cait.cumc.columbia.edu.
>   |Here is my code snippet:
>   ...
>   |
>   |             String user = "blm14";
>   |             //String host = "cait.cumc.columbia.edu";
>   |             String rhost = "nine.cpmc.columbia.edu";
>   |             String host = "cait.cumc.columbia.edu";
>   |             int sshPort = 22, lport = 6666, rport = 3306;
>   |             Session session = jsch.getSession(user, host, sshPort);
>   |             session.setConfig(config);
>   |             session.setHost(host);
>   |             session.setPassword("<redacted>");
>   |             session.connect();
>   |             int assigned_port = session.setPortForwardingL(lport, rhost,
>   |rport);
>   |             Class.forName("com.mysql.jdbc.Driver").newInstance();
>   |             mysql = DriverManager.getConnection
>   |                 ("jdbc:mysql://gem.cumc.columbia.edu:" + lport +
>   |                  "/hiccc_clinicaltrials","blm14","<redacted>");
>
> It seems to me that "rhost" should be "gem.cumc.columbia.edu", according to
> your scenario. And also, you should refer to "127.0.0.1:"+assigned_port ;
>
>   int assigned_port = session.setPortForwardingL(0, rhost, rport);
>   Class.forName("com.mysql.jdbc.Driver").newInstance();
>   mysql = DriverManager.getConnection("jdbc:mysql://127.0.0.1:" +
>                                       assigned_port +
>                                       "/hiccc_clinicaltrials",
>                                       "blm14","<redacted>");
>
>
> Sincerely,
> --
> Atsuhiko Yamanaka
> JCraft,Inc.
> 1-14-20 HONCHO AOBA-KU,
> SENDAI, MIYAGI 980-0014 Japan.
> Tel +81-22-723-2150
> Skype callto://jcraft/
> Twitter: http://twitter.com/ymnk
> Facebook: http://facebook.com/aymnk
>
>
>

Sincerely,
Ben May
Senior Research Analyst
Herbert Irving Comprehensive Cancer Center
212-851-4772

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to