/** * 调用存储过程的方法:存储过程实现具体看PKG_SYS.sql * <B>方法名称:</B>清空文件缓存方法<BR> * <B>概要说明:</B>清空文件缓存方法<BR> * @return List<String> 主键KEY集合 */ public List<String> clearFileKeys() { SimpleJdbcCall call = new SimpleJdbcCall(this.getJdbcTemplate()). withCatalogName("PKG_SYS").withProcedureName("CLEAR_FILES"). declareParameters(new SqlOutParameter("P_RET_REFCUR", OracleTypes.CURSOR)); Map<String, Object> m = call.execute(); if(m.values().size() > 0){ String temp = m.values().toArray()[0].toString().replace("[", "").replace("]", ""); String[] keys = temp.split(","); List<String> ret = new ArrayList<String>(); for(String key : keys){ String temp1 = key.replace("{", "").replace("}", ""); if(!StringUtils.isBlank(temp1)){ ret.add(temp1.split("\\=")[1]); } } return ret; } return Collections.emptyList(); }
@Override public String [] get() throws Exception { SimpleJdbcCall call = new SimpleJdbcCall(this.getJdbcTemplate()); call.withFunctionName("usecase01_get"); call.withSchemaName("public"); call.withoutProcedureColumnMetaDataAccess(); call.declareParameters(new SqlOutParameter("testcolumn", java.sql.Types.ARRAY)); MapSqlParameterSource map = new MapSqlParameterSource(); Map<String, Object> result = call.execute(map); Jdbc4Array jdbc4Array = (Jdbc4Array)result.get("testcolumn"); try { Object o = jdbc4Array.getArray(); Logger.getLogger(PostgresArrayImpl.class.getName()).log(Level.SEVERE, null, o); return (String [])o; } catch (SQLException ex) { Logger.getLogger(PostgresArrayImpl.class.getName()).log(Level.SEVERE, null, ex); throw ex; } }
/** * Executes a given procedure against the datasource. * @param procedureName The name of the procedure to execute. * @param parameters The parameters for the procedure. * @return The Map of returned values from the procedure. */ public Map<String, ?> executeProcedure(String procedureName, Map<String, ?> parameters) { SimpleJdbcCall call = new SimpleJdbcCall(this.datasource).withSchemaName("lodbot").withProcedureName(procedureName); SqlParameterSource callParameters = new MapSqlParameterSource(parameters); return call.execute(callParameters); }
public SimpleJdbcCall getSimpleJdbcCall() { return simpleJdbcCall; }
public void setSimpleJdbcCall(SimpleJdbcCall simpleJdbcCall) { this.simpleJdbcCall = simpleJdbcCall; }