Java examples for JDBC:Stored Procedure
Create a function named myfuncin which returns a VARCHAR value; the function has an IN parameter named x
import java.sql.Connection; import java.sql.Statement; public class Main { public static void main(String[] args) throws Exception{ Connection connection = null; Statement stmt = connection.createStatement(); String function =//from www . j a v a 2 s . co m "CREATE OR REPLACE FUNCTION myfuncin(x VARCHAR) RETURN VARCHAR IS " + "BEGIN " + "RETURN 'a return string'||x; " + "END;"; stmt.executeUpdate(function); } }