- 浏览: 681056 次
- 性别:
- 来自: 中山
文章分类
最新评论
-
wuhuizhong:
jFinal支持Rest风格吗?可以想spring mvc那样 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
在jfinal中应如何获取前端ajax提交的Json数据?ht ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
jfinal如何处理json请求的数据:问题: 在某些api接 ...
在JFinal的Controller中接收json数据 -
wuhuizhong:
Ubuntu14.04 安装 Oracle 11g R2 Ex ...
Oracle 11g release 2 XE on Ubuntu 14.04 -
alanljj:
这个很实用,已成功更新,谢过了!
odoo薪酬管理模块l10n_cn_hr_payroll
CREATE OR REPLACE TYPE STRARRAY AS TABLE OF VARCHAR2 (255) / CREATE OR REPLACE PACKAGE DEMO_PASSING_PKG AS -- Varchar2's are most easily mapped to the java String type PROCEDURE PASS ( P_IN IN VARCHAR2, P_OUT OUT VARCHAR2) AS LANGUAGE JAVA NAME 'demo_passing_pkg.pass( java.lang.String, java.lang.String[] )'; PROCEDURE PASS ( P_IN IN STRARRAY, P_OUT OUT STRARRAY) AS LANGUAGE JAVA NAME 'demo_passing_pkg.pass_str_array( oracle.sql.ARRAY, oracle.sql.ARRAY[] )'; FUNCTION RETURN_STRING RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'demo_passing_pkg.return_string() return java.lang.String'; END DEMO_PASSING_PKG; /
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "demo_passing_pkg" AS import java.io.*; import java.sql.*; import java.math.*; import oracle.sql.*; import oracle.jdbc.driver.*; public class demo_passing_pkg extends Object{ public static void pass( java.lang.String p_in, java.lang.String[] p_out ){ /* * the simplest of datatypes -- the String. If you remember * the C version with 6 formal parameters, null indicators, * strlen's, strcpy's and so on -- this is trivial in * comparision */ if ( p_in != null ){ System.out.println ( "The first parameter is " + p_in.toString() ); p_out[0] = p_in.toUpperCase(); System.out.println ( "Set out parameter to " + p_out[0].toString() ); } } private static void show_array_info( oracle.sql.ARRAY p_in ) throws SQLException{ System.out.println( "Array is of type " + p_in.getSQLTypeName() ); System.out.println( "Array is of type code " + p_in.getBaseType() ); System.out.println( "Array is of length " + p_in.length() ); } public static void pass_str_array( oracle.sql.ARRAY p_in, oracle.sql.ARRAY[] p_out ) throws java.sql.SQLException,IOException{ show_array_info( p_in ); String[] values = (String[])p_in.getArray(); for( int i = 0; i < p_in.length(); i++ ) System.out.println( "p_in["+i+"] = " + values[i] ); Connection conn = new OracleDriver().defaultConnection(); ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor( p_in.getSQLTypeName(), conn ); p_out[0] = new ARRAY( descriptor, conn, values ); } public static String return_string(){ return "Hello World"; } }
SET serveroutput on size 1000000 EXEC dbms_java.set_output( 1000000 ) DECLARE L_IN STRARRAY := STRARRAY (); L_OUT STRARRAY := STRARRAY (); BEGIN FOR I IN 1 .. 5 LOOP L_IN.EXTEND; L_IN (I) := 'Element ' || I; END LOOP; DEMO_PASSING_PKG.PASS (L_IN, L_OUT); FOR I IN 1 .. L_OUT.COUNT LOOP DBMS_OUTPUT.PUT_LINE ('l_out('|| I || ') = ' || L_OUT (I) ); END LOOP; END; /
o STRARRAY is simply our Oracle type that represents the array (collection) we want to
pass.
o DEMO_PASSING_PKG is our "binding" to the java. Maps the SQL types to the Java types.
o when you run the PLSQL block at the bottom of your question, we are calling the code:
public static void
pass_str_array( oracle.sql.ARRAY p_in, oracle.sql.ARRAY[] p_out )
throws java.sql.SQLException,IOException{
show_array_info( p_in );
String[] values = (String[])p_in.getArray();
for( int i = 0; i < p_in.length(); i++ )
System.out.println( "p_in["+i+"] = " + values[i] );
Connection conn = new OracleDriver().defaultConnection();
ArrayDescriptor descriptor =
ArrayDescriptor.createDescriptor( p_in.getSQLTypeName(), conn );
p_out[0] = new ARRAY( descriptor, conn, values );
}
That code just
1) dumps the array meta data -- type name, length and so on.
2) gets the array of java strings from the parameter (p_in.getArray())
3) prints out each string in turn (system.out.println)
4) creates a new array to be returned (first half of example shows how to PASS IN, second
half shows how to pass OUT).
5) Then, it copies the values in the array we want to return into the OUT parameter.
发表评论
-
用函数unistr将Oracle数据库中的Unicode转换为中文
2016-07-19 11:51 7918例子: DECLARE V_EXT_DES V ... -
ORACLE APPLICATION EXPRESS 5.0 升级
2016-05-12 11:43 580Oracle11GR2 XE 缺省是安装了oracle ap ... -
Oracle ACL(Access Control List)
2016-05-12 11:36 889在oralce 11g中假如你想获取server的ip或者h ... -
如何随机产生唯一的app_key和app_secret
2016-05-06 08:57 2882UUID含义是通用唯一识 ... -
develop web service
2016-05-04 07:13 457develop a RESTful we ... -
了解systemstate dump
2016-04-26 14:09 487当数据库出现严重的性能问题或者hang了的时候,我们非常需要 ... -
通过ORACLE的UTL_HTTP工具包发送包含POST参数的请求
2016-03-18 16:25 5152DECLARE req utl_http. ... -
Shell: extract more from listener.log(分析监听日志)
2016-03-16 14:57 1148统计一天内每小时的session请求数 # fgrep ... -
快速上手JFinal
2016-03-16 00:12 553JFinal是国产的MVC框架,由 Handler、Inte ... -
jfinal用fastjson处理json的插件
2016-03-15 23:37 2228FastJsonActiveRecordPlugin: p ... -
在JFinal的Controller中接收json数据
2016-03-15 23:31 3409原文 http://boytnt.blog.51cto.c ... -
jfinal中model转map
2016-02-25 23:33 1010import java.util.HashMap; i ... -
ORA-01031: insufficient privileges 问题解决笔记
2016-02-01 15:53 1185A) File $Oracle_HOME/network/a ... -
listener.log中报Warning: Subscription For Node Down Event Still Pending问题的解决方法
2016-01-07 16:34 1633一套Oracle 10.2.0.1 for aix的数据库环 ... -
获取股票实时交易数据的方法
2015-12-01 23:47 9302调用sina专门的js服务器来获得数据,速度飞快: htt ... -
Oracle触发器和MySQL触发器之间的区别
2015-11-19 12:55 669Oracle触发器格式: CREATE [OR RE ... -
Myeclipse验证js语法报错
2015-11-14 14:09 657js报红叉,点进js文件发现错误信息如下: The lef ... -
查询正在执行的存储过程
2015-11-13 09:27 20501、找正在执行的PROCEDURE的 sid ,serial# ... -
eclipse server整合tomcat
2015-11-02 17:32 528安装配置tomcat 8http://jingyan.ba ... -
undo表空间损坏的处理过程
2015-10-14 13:49 1219磁碟陣列故障,分區/rman上包括undo和archivel ...
相关推荐
The PL/SQL native compiler generates native code directly, bypassing the intermediate bytecode generation step. This results in faster execution times and reduced memory usage. The native code is ...
SELECT column_value FROM XMLTable('/root/element' PASSING xmltype('<root><element>Value1</element><element>Value2</element></root>') COLUMNS value VARCHAR2(50) PATH '.'); ``` 4. **XSLT ...
jGuru has been dedicated to promoting the growth of the Java technology community through evangelism, education, and software since 1995. You can find out more about their activities, including ...
Reactive Streams in Java explains how to manage the exchange of stream data across an asynchronous boundary―passing elements on to another thread or thread-pool―while ensuring that the receiving ...
3. 编写PL/SQL过程:为了从XML数据中提取信息,可能需要编写PL/SQL过程来解析XML。可以使用Oracle的内置XML处理函数如XMLTYPE,XMLELEMENT,XMLFOREST等。 4. 使用SQL*Loader加载数据:最后,运行SQL*Loader命令,...
### Python 函数传参详解 在 Python 编程语言中,函数是代码组织的重要组成部分,而函数参数则是函数与外部程序交互的关键。本文将详细解释 Python 函数中的三种不同的参数传递方式:无星号参数、单星号参数(*args...
ArrayIndexOutOfBoundException is thrown when we have to indicate that an array has been accessed with an illegal index. printStackTrace in jsp printStackTrace is a method of the Throwable class. By ...
在编程中,数组是一种存储多个同类型数据的集合,而函数则是执行特定任务的代码块。当涉及到多维数组,如二维数组(行与列组成的矩阵),在处理复杂问题时非常有用。本主题将深入探讨如何在编程环境中,特别是在C++...
you would typically create an instance of `FileInputStream`, passing the file path as a parameter, then call the `read()` method repeatedly to read bytes from the file. The `read()` method returns ...
google-java-format is a program that reformats Java source code to comply with Google Java Style. The formatter can act on whole files, on limited lines, on specific offsets, passing through to ...
Exam Ref 70-761 Querying Data with Transact-SQL by Itzik Ben-Gan English | 4 Apr. 2017 | ASIN: B06Y21QGGQ | 352 Pages | AZW3 | 23.79 MB Prepare for Microsoft Exam 70-761–and help demonstrate your ...
This book proposes to be an integration of the theoretical aspects of java programming complemented with the implementation of the same in real world situations. The book would be all encompassing ...
这份标题为"EMC-AN103-RDS_gigabit PHY layout.pdf"的文档主要讨论了在设计网卡电路板时,如何通过电路板布局来优化EMI/EMC(电磁干扰和电磁兼容)性能。Broadcom作为知名品牌,其提供的这款10/100和千兆PHY(物理层...
11. 数组的使用(Accessing Array Elements in a Loop, Passing an Array to a Method) 掌握如何在循环中访问和操作数组元素。学习如何将数组作为参数传递给方法,并在方法中操作数组。 12. 方法返回对象...
collinear arrays and stacked element arrays, with gains ranging from 3 to 9 dB1. The higher gain antennas have a lower vertical beamwidth. For example, a typical 4-element exposed dipole offset array ...
matlab转换java代码utl_passing_sas_macro_variables_to_R_and_retrieving_macro_variables_from_R 将宏变量传递给R并从R中检索宏变量。关键字:sas sql连接合并大数据分析宏oracle teradata mysql sas社区...
To achieve this, one computational approach for representing human relationships and attributes is to use an explicit knowledge graph, which allows for high-level reasoning. We introduce a novel end-...
Microservices can be seen as an extension of the basic idea of modularity: programs connected by message-passing instead of direct API calls so that they can be distributed among multiple services....