An Exception has occurred! com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 1.
views:
39answers:
1
+2
A:
You have a PreparedStatement
with at least one valueholder ?
. When you execute it without having set the valueholder with a value using one of the PreparedStatement
's setter methods, then you will get this exception. To solve this you obviously need to set the value with the desired value, e.g.
preparedStatement.setString(1, value);
Or if you don't need it at all, then just remove it from the SQL string or create another one for this specific purpose.
For more about PreparedStatement
s, consult the JDBC tutorial.
BalusC
2009-11-09 13:24:34
perfect answer!
tony_le_montana
2009-11-09 17:06:50