title: java.sql.SQLException: 'Infinity' is not a valid numeric or approximate numeric value
body: <p>I am using a java function which returns a float </p>
  
  <pre><code>private float getEventScaledX(float eventX, float resX) {
      return (eventX * frameWidth) / resX;
  }
  </code></pre>
  
  <p>While storing it under mysql db it throws exception as </p>
  
  <pre><code>Caused by: java.sql.SQLException: 'Infinity' is not a valid numeric or approximate numeric value
  </code></pre>
  
  <p>Please suggest a right way to handle it at java side to stop this exception but also to get right expected result.</p>