Parameter number 2 is not an OUT parameter
String sqlString = "{CALL MyStoredProcedure(?,?)}"; CallableStatement sqlStm = connection.prepareCall(sqlString); sqlStm.setString(1, username); sqlStm.registerOutParameter(2, Types.DECIMAL, 0); // <---- ERROR sqlStm.execute(); This is my error stacktrace: java.sql.SQLException: Parameter number 2 is not an OUT parameter at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql