Im calling a stored function like the following:
PreparedStatement deleteAll=connection.prepareStatement("{ call delete_all_data() }");
deleteAll.execute();
And in the logs i see:
15:16:31,950 WARN SqlExceptionHelper:143 - SQL Error: 0, SQLState: 42601
15:16:31,950 ERROR SqlExceptionHelper:144 - ERROR: syntax error at or near "{"
Position: 1
what is wrong with the prepareStatement??
Change
connection.prepareStatement
(which expects SQL) toconnection.prepareCall
. That may very well be the only change you need, as aCallableStatement
is aPreparedStatement
.