title: JDBC parsing int from SQL query
body: <p>I am pretty new to programming in Java and am having a little difficulty. I have searched around but could not get an exact answer for what I am trying to do.</p>
  
  <p>Basically, I have created a 3-tier application that uses servlets running on a server to access a mySQL database using JDBC.</p>
  
  <p>For the most part, my application runs fine. I am able to run my queries and display my results.</p>
  
  <p>The problem is, I need to implement some logic based on my query, which is a String.</p>
  
  <p>For example,</p>
  
  <p>ex1_query: <code>insert into parts values ('S5', 'P6', 'J7', 50);</code></p>
  
  <p>ex2_query: <code>insert into parts values ('S5', 'P6', 'J7', 400);</code></p>
  
  <p>My queries are being submitted through an HTML form as single string. As you can see, the only difference between ex1_query and ex2_query is their last value (50 &amp; 400).</p>
  
  <p>The logic is, that if that last value is >=100, I need to implement some stuff…</p>
  
  <p>If that value is &lt;100, just run the query as specified.</p>
  
  <p>My queries will always be entered in that format, but that last value may vary from 0 - 1000.</p>
  
  <p>So my question is… how can I parse just that last int from the string? So I can determine whether I should or should not implement some specific logic?</p>
  
  <p>I know it sounds pretty simple, but I am having a little trouble. Any help or guidance would be appreciated. Thanks</p>