My Oracle Support Banner

Multiple Use of a Single Bind Parameter Runs Into java.sql.SQLException: Missing IN or OUT parameter at index (Doc ID 353644.1)

Last updated on SEPTEMBER 11, 2019

Applies to:

JDBC - Version 9.0.1.0 and later
Information in this document applies to any platform.

Symptoms

The following code snippet shows how to make multiple use of a bind parameter. This code worked with Oracle JDBC Drivers < 10.x.


PreparedStatement pstmt = 
  conn.prepareStatement("SELECT users_ID FROM Users t WHERE t.users_ID = :1 and t.companies_id = :1");
pstmt.setInt(1,1);
pstmt.execute();

However, it throws:
java.sql.SQLException: Missing IN or OUT parameter at index:: 2

after upgrading Oracle JDBC Driver to 10.x.

Changes

Upgrade of Oracle JDBC Driver from "< 10.x" to ">= 10.x".

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.