title: Jsch to execute a sql query
body: <p>I have to remotely access a machine and execute a query, I use ChannelExec and set the commands I have to run. I execute this commands on the machine succesfully:</p>
  
  <pre><code>su - postgres
  </code></pre>
  
  <p>and</p>
  
  <pre><code>psql -U someUser myDatabase
  </code></pre>
  
  <p>then I'm in the database command line, but when I try to execute a query it always fails, I think because the channel always adds bash: -c and then the command. How can I avoid that in order to execute my query?</p>