Java examples for JDBC:Stored Procedure
Create procedure myproc with no parameters
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 procedure =/*from w ww . j a v a 2s . c om*/ "CREATE OR REPLACE PROCEDURE myproc IS " + "BEGIN " + "INSERT INTO oracle_table VALUES('string 1'); " + "END;"; stmt.executeUpdate(procedure); } }