As of now, if you want your app to be database independent,
you should avoid stored procedures. I've been reading about
Java stored procedures where the languages isn't PL/SQL. I don't know how common support is now though.
I'd question if you really need a stored procedure though. Many complex queries can be written using
JDBC and remain database independent.