Mam taki problem:
String endLineStr = " # ";
String host = "cos";
String user = "cos";
String password = "cos";
int port = 22;
JSch shell = new JSch();
Session session = shell.getSession(user, host, port);
session.setUserInfo(new SSHUserInfo(password));
session.connect();
Channel channel = session.openChannel("shell");
channel.connect();
DataInputStream dataIn = new DataInputStream(channel.getInputStream());
DataOutputStream dataOut = new DataOutputStream(channel.getOutputStream());
// send ls command to the server
dataOut.writeBytes("mysql -uroo -ppass sb_a -e 'select a,b from c '> output.file");
dataOut.flush();
ladnie mi do tego pliku output zapisalo wynik zapytania.
Ale jak teraz z tego pliku (albo bezposrednio wynik zamist do pliku) wrzuci do stringa... kompletnie tego nie widze jak to zrobic