title: MySQL - java.sql.SQLException: ResultSet is from UPDATE. No Data
body: <pre><code>public static void main(String args[])
      {
  
              SQLConnector sqlConnect = new SQLConnector();
              Connection conn = null;
              try
              {
              conn= sqlConnect.getConnection();
              CallableStatement cStmt = conn.prepareCall("{ call test(?,?,?)}");
              cStmt.setDouble(1, 100.0);
              cStmt.setInt(2, 1);
              cStmt.registerOutParameter(3, java.sql.Types.VARCHAR);
              ResultSet rs = cStmt.executeQuery();
              if (rs.next()) {
                  System.out.println(rs.getString(3);
                  }
              cStmt.execute();
              }
              catch(Exception e)
              {
                  e.printStackTrace();
              }
              finally
              {
                  sqlConnect.closeConnection(conn);
              }
          }
  </code></pre>
  
  <p>This snippet throws the error </p>
  
  <pre><code>java.sql.SQLException: ResultSet is from UPDATE. No Data.
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
  </code></pre>
  
  <p>But if I pass the same parameters from MySQL Workbench it gives proper output.</p>
  
  <p>I am using MySQLServer 5.6.25 and MySQLConnector 5.1.6.</p>
  
  <p>Please help me solve this problem. This looks like a bug in the way I call MySQL from Java</p>