Question

I used an sql insert into a database table and I got the following exception:

Error executing query: class org.springframework.jdbc.BadSqlGrammarException:PreparedStatementCallback; bad SQL grammar [insert into SAKAI_ENVIOSIMPRIMIR (IDRECURSO, IDUSUARIO, IDSERVICIOREPROGRAFIA, SENDDATE, COLLECTDATE, PRINTDATE, STATE, NUMBEROFCOPY, DOUBLESIDE, BOUNCE) values (?,?,?,?,?,?,?,?,?,?)]; nested exception is java.sql.SQLException: No value specified for parameter 10

It said that there is no value in parameter 10. Does it mean BOUNCE contains null?

Was it helpful?

Solution

Yes - if you're using a PreparedStatement you have to bind a value to every ? in your SQL string. So somewhere in your code there should be something like:

stmt.setSOMETHING(10, foo);

If you have that then please show your code so we can help you figure out what's going on.

OTHER TIPS

Generally, Sakai discourages people from directly manipulating the database tables. APIs are provided for all of the kernel services and many tools also publish and API to access data controlled by that tool. APIs are a much safer way to work with Sakai data since the database tables may change from one release to the next. Naturally, there are some exceptions to this policy, but have a look at the Java APIs and see if they meet your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top