I get the following error when working on some JDBC code:
java.sql.sqlexception missing in or out parameter at index: 6
Can somebody explain what this means? More generally, is there a website/set of documentation that will explain what an error statement means?
You have a statement like:
select foo from bar where a=? and b=? and c=? ...
You code binds the values to parameters:
st.setInteger(1,123); // goes to a
st.setString(2,"hello"); // goes to b
...
Now, parameter #6 is not bound, no value provided. Statement doesn't know what value to send over to DB (it will not send NULL by default). You should do something like this if parameter value is not known:
st.setNull(6,Types.VARCHAR);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With