[英]what does the following error mean: java.sql.sqlexception missing in or out parameter at index
I get the following error when working on some JDBC code: 在处理一些JDBC代码时出现以下错误:
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. 现在,参数#6没有绑定,没有提供任何值。 Statement doesn't know what value to send over to DB (it will not send NULL by default).
Statement不知道要向DB发送什么值(默认情况下不会发送NULL)。 You should do something like this if parameter value is not known:
如果参数值未知,您应该执行以下操作:
st.setNull(6,Types.VARCHAR);
Can you paste your PreparedStatement code? 你可以粘贴PreparedStatement代码吗? What this means is that you have have an extra ?
这意味着你有额外的? in the statement for which you're not setting a value.
在您未设置值的语句中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.