简体   繁体   English

以下错误意味着什么:java.sql.sqlexception在索引中缺少in或out参数

[英]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.

相关问题 线程“ main”中的异常java.sql.SQLException:索引处缺少IN或OUT参数:25此错误是什么意思 - Exception in thread “main” java.sql.SQLException: Missing IN or OUT parameter at index:: 25 What was this error meant java.sql.SQLException:索引处缺少 IN 或 OUT 参数:: 1 - java.sql.SQLException: Missing IN or OUT parameter at index:: 1 原因:java.sql.SQLException:索引处缺少 IN 或 OUT 参数::1 - Caused by: java.sql.SQLException: Missing IN or OUT parameter at index:: 1 错误代码 [17041]; 索引处缺少 IN 或 OUT 参数:: 1; 嵌套异常是 java.sql.SQLException: Missing IN or OUT parameter at index::1 - error code [17041]; Missing IN or OUT parameter at index:: 1; nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 1 java.sql.SQLException:在index :: 4处缺少IN或OUT参数时,preparestatement发生错误 - java.sql.SQLException: Missing IN or OUT parameter at index::4 error occurs with preparestatement 错误java.sql.SQLException:参数索引超出范围 - error java.sql.SQLException: Parameter index out of range java.sql.SQLException:即使提供正确数量的参数,索引处的IN或OUT参数也丢失 - java.sql.SQLException: Missing IN or OUT parameter at index, even when I provide correct number of parameter java.lang.NumberFormatException:ForInputString“ 7110332507339” java.sql.SQLException:在Index :: 4处缺少IN或OUT参数 - java.lang.NumberFormatException: ForInputString“7110332507339” java.sql.SQLException: Missing IN or OUT Parameter at Index::4 in java oracle How can I bind value,java.sql.SQLException: Missing IN or OUT parameter at index:: - in java oracle How can I bind value ,java.sql.SQLException: Missing IN or OUT parameter at index:: 获取java.sql.SQLException:JAVA中的CallableStatement上的索引:: 4缺少IN或OUT参数 - Getting java.sql.SQLException: Missing IN or OUT parameter at index:: 4 on CallableStatement in JAVA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM