List of utility methods to do SQL Stored Procedure
void | executeProcedure(Connection session, String sql) execute Procedure try (PreparedStatement dbStat = session.prepareCall(sql)) {
dbStat.execute();
|
void | executeSqlScript(Connection conn, InputStream inputFile) execute Sql Script String delimiter = ";"; Scanner scanner; scanner = new Scanner(inputFile).useDelimiter(delimiter); Statement currentStatement = null; while (scanner.hasNext()) { String rawStatement = scanner.next() + delimiter; try { currentStatement = conn.createStatement(); ... |
void | executeSqlScript(Connection connection, URL scriptUrl) Executes SQL script. for (String sqlStatement : readSqlStatements(scriptUrl)) { if (!sqlStatement.trim().isEmpty()) { connection.prepareStatement(sqlStatement).executeUpdate(); |
void | createTestProcedure() create Test Procedure java.sql.Connection jdbcConn = openJDBCConnection(); String str = ""; java.sql.Statement jdbcStmt = jdbcConn.createStatement(); for (int i = 0; i < DATA_TYPES.length; i++) { str = "drop procedure" + PROCEDURE_BASE_NAME + i; try { jdbcStmt.execute(str); } catch (Exception e) { ... |