title: Java SQL Exception Missing IN or OUT parameter at index:: 1
body: <p>This seems to be a frequent question around here, but no specific answer. I've never encountered the issue before. The code is here:</p>
  
  <pre><code>public static Reservation retrieveReservation()throws IOException,
     SQLException{
     Reservation testRsv = new Reservation();
     try {
        Connection con = null;
  
        Class.forName("oracle.jdbc.driver.OracleDriver");
        con=DriverManager.getConnection(
           "jdbc:oracle:thin:@wewe",
           "ewew",
           "sdsds");
        con.setAutoCommit(false);
        try {
           PreparedStatement prepareStatement = con.prepareStatement("SELECT *
           FROM SMD_RESERVATION_INSTANCES WHERE id = ?");
           ResultSet rset = prepareStatement.executeQuery();
           prepareStatement.setString(1, localIDTest);
           prepareStatement.executeUpdate();
           prepareStatement.close();
           con.commit();
           if(rset.next()){
              retrievedID = rset.getString("ID");
              Blob blob = rset.getBlob("RESERVATIONINST");
              status = rset.getString("STATUS");
              long blobLength = blob.length();
              int pos = 1;   // position is 1-based
              int len = 10;
              byte[] bytes = blob.getBytes(pos, len);
              InputStream is = blob.getBinaryStream();
              ObjectInputStream ois = new ObjectInputStream(is);
              testRsv = (Reservation)ois.readObject();
           }
  
           // System.out.println("Map Size: " + retrievedmap.size());
           rset.close();
           con.close();
        }catch(IOException ioe){
           System.err.print(ioe);
        }
     }catch(ClassNotFoundException cnfe){
        System.err.print(cnfe);
     }
     return testRsv;
  }
  </code></pre>
  
  <p>it produces the following:</p>
  
  <pre><code>java.sql.SQLException: Missing IN or OUT parameter at index:: 1
  </code></pre>
  
  <p>Any idea why?
  I've re-checked the variables as parameters that is the ID and its not null and has a value.</p>