Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6943057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:06:22+00:00 2026-05-27T13:06:22+00:00

This seems to be a frequent question around here, but no specific answer. I’ve

  • 0

This seems to be a frequent question around here, but no specific answer. I’ve never encountered the issue before. The code is here:

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;
}

it produces the following:

java.sql.SQLException: Missing IN or OUT parameter at index:: 1

Any idea why?
I’ve re-checked the variables as parameters that is the ID and its not null and has a value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:06:22+00:00Added an answer on May 27, 2026 at 1:06 pm

    You have to change the order of statement,

    PreparedStatement prepareStatement = con.prepareStatement("SELECT * FROM 
                SMD_RESERVATION_INSTANCES WHERE id = ?");
      prepareStatement.setString(1, localIDTest);
      ResultSet rset = prepareStatement.executeQuery();
    

    remove these statement (don’t close the connection while you are reading).

    prepareStatement.executeUpdate();
    prepareStatement.close();
    con.commit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems trivial, but I've never had to worry about it before and my
This seems like a pretty softball question, but I always have a hard time
This seems like a simple question, but I can't find it with the Stack
This seems to be an absurdly simple question but Google and Stack Overflow searches
This seems like a straightforward question, but I haven't had any good answers from
This seems to be a common problem but I cannot find a solution. I
This seems to me to be the kind of issue that would crop up
This seems trivial yet endless searching doesn't yield an answer. I need to compare
This seems like a pretty efficient way to do error handling, but I want
This seems to be a non-issue for many people (read: I can't find an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.