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??
CallableStatementfor stored procedures.connection.prepareStatement("select delete_all_data()")is enough. NoCallableStatementneededStatementandPreparedStatement. This should work as long as the stored procedure doesn't haveOUTparameters (PreparedStatement) or parameter placeholders (forStatement). However in practice most drivers only support it withCallableStatement.