Server side program SQL server, interbase and AS400

we are using Delphi 400 C/S 3.0 and want my application to work with 3
databases: Interbase, Ms SQL server and AS400 with the same code.
We manage to have only one program with the client side of our application
(with SQL links and generic SQL programming) . The same program could work
with the 3 database server.
But what about on the server side ...

Could we use sored procedures ?

...Every Database server has its own langage
In AS400 the storered proc have to be embedded in RPG or COBOL langage

Is there a Java based solution?
Is there a product able to generate stored proc for different target with
only one source ?