Is it possible to run linux shell commands though jdbc in java code and how? I have been trying this:
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection("jdbc:mysql://" + this.host + "/" + this.db + "?", properties);
statement = connect.createStatement();
String sql = "\\! touch /home/dbsms/testfile";
statement.execute(sql);
but I'm getting "You have an error in your SQL syntax;" error. The reason why I am trying this: MySQL server is running on a machine which is on a protected (no internet) network. My java application is designed to manipulate DB. It is a document management DB. So once a new document is inserted into DB I need to notify users. There is another machine on the same network which is able to send SMS. What I need to to is create a file that contains a text of an SMS and is named as a phone number, and the deamon on SMS machine will pick it up and process. I know that there are libs that would let me execute shell command on a remote computer via ssh, but I would like to use jdbc if possible.