これは頻繁にここでの質問ですが、具体的な回答はありません。以前はこの問題に遭遇したことはありません。コードはここにある:Java SQL例外インデックスにINまたはOUTパラメータがありません::
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;
}
それは次のように生成します。
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
任意のアイデアなぜですか? 私は変数をIDとそのnullではなく、値を持つパラメータとして再チェックしました。
感謝:) –