title: Passing a query argument from php to a java jar file
body: <p>I have a login page written in php and I want to pass the query to a jar file ,the java jar file should check the query sent by php for some keywords ,can someone help me please!
  thanks.</p>
  
  <p><strong>this is a part of my php code</strong></p>
  
  <pre><code>&lt;?php
   $username=$_POST['username'];
   $password=$_POST['password'];
  
   if($username&amp;&amp;$password)
    {
     $connect=mysql_connect("localhost","root","123") or die("Couldnt connect to Database");
     mysql_select_db("test") or die("Couldnt find Database");
     $query = mysql_query("SELECT * FROM users WHERE username='$username'");
      exec("java -jar QuerySignature.jar $query");
  
      $numrows = mysql_num_rows($query);
  
      if($numrows!==0)
       {
          while($row = mysql_fetch_assoc($query))
       {
        $dbusername = $row['username'];
        $dbpassword=$row['password'];
         }
        if($username==$dbusername&amp;&amp;$password==$dbpassword )
            {
          echo "You are logged in!";
  </code></pre>
  
  <p>I excuted the jar file and sent the <strong>$query</strong> as an argument I want the java program to read the query <strong>it self</strong> <strong><em>NOT</em></strong> the return value </p>
  
  <pre><code> exec("java -jar QuerySignature.jar $query");
  </code></pre>
  
  <p>Am I doing right here?</p>
  
  <p><strong>and this is my java program</strong>
  <strong>QuerySignature.java</strong></p>
  
  <pre><code>       public static void main (String a[])
        { QuerySignature q1= new QuerySignature();
        String s = "select * from employee where id=20 and name='Angel' or age=20";
         String QueryKey = q1.Msg_Init(s);
        try {
        q1.Msg_Md5(QueryKey);
        } catch (Exception e) {}
  </code></pre>
  
  <p>I want to know, how to execute the passed argument from php instead of this line in my java program:</p>
  
  <pre><code>"select * from employee where id=20 and name='Angel' or age=20";
  </code></pre>
  
  <p>Sorry ,I know I am being annoying here ..but help me out and thank u.</p>