title: java.sql.SQLException: ORA-00933: SQL command not properly ended
body: <p>What i want to accomplish, is to be able to write SQL statements and verify the results.
  The SQL Statements would have variables in them, like :</p>
  
  <pre><code>String sql = "Select  zoneid from zone where zonename = myZoneName";
  </code></pre>
  
  <p>Where myZoneName is generated from count + </p>
  
  <p>Note: I use Apache POI to parse Excel Spreadsheet.</p>
  
  <p>here is the code:</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.util.Properties;
  
  import org.apache.log4j.Logger;
  import org.junit.Test;
  
  public class VerifyDBSingleDomain {
  
      static Logger log = Logger.getLogger(VerifyDBSingleDomain.class.getName());
  
      String url = "jdbc:oracle:thin:@a.b.c.d:1521:mname";
  
      @Test
      public void VerifyDBSingleDomainTest() throws SQLException {
  
          Properties props = new Properties();
          props.setProperty("user", "user");
          props.setProperty("password", "password");
  
          String sql = "Select  zoneid from zone where zonename = 99224356787.tv";
          //String sql = "Select * from zone";
  
          Connection conn;
          //try {
              conn = DriverManager.getConnection(url, props);
              PreparedStatement preStatement = conn.prepareStatement(sql);
              ResultSet result = preStatement.executeQuery();
              System.out.println(result);
  
              /*while (result.next()) {
                  System.out.println(result.toString());
              }
          } catch (SQLException e) {
  
              e.printStackTrace();
          }*/
  
      //  }
      //}
  
      }
  }
  </code></pre>
  
  <p>and i get error:</p>
  
  <pre><code>java.sql.SQLException: ORA-00933: SQL command not properly ended
  </code></pre>