Java examples for JDBC:Stored Procedure
Create procedure myprocin with an IN parameter named x. IN is the default mode for parameter
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. jav a2 s .c o m*/ "CREATE OR REPLACE PROCEDURE myprocin(x VARCHAR) IS " + "BEGIN " + "INSERT INTO oracle_table VALUES(x); " + "END;"; stmt.executeUpdate(procedure); } }