oracleµ÷ÓÃjava·½·¨´íÎó - Oracle / ¿ª·¢
oracleµ÷ÓÃjava·½·¨´íÎó: ORA-29541: ÎÞ·¨½âÎöÀà.
¹ý³ÌÈçÏÂ:
1.Ê×ÏÈÎÒ×öÁËн¨ÁËÒ»¸ö²âÊÔµÄÏîÄ¿,ÀïÃæ¾ÍÖ»ÓÐÒ»¸öµ¥¶ÀµÄMain²âÊÔÀà. ÀïÃæÓÐÒ»¸ö·½·¨:
public static String sayHello(String name){
return " hello " + name;
}
2.È»ºó°ÑÏîÄ¿´ò°ü³Éprj.jar.
ÎÒÓÃloadjava -user sys/sys@databaseName prj.jar
select DBMS_JAVA.LONGNAME(OBJECT_NAME) as OBJECT_NAME
from USER_OBJECTS
where OBJECT_TYPE like 'JAVA%'
and object_name like '%Main'
ÒѾ²éѯµ½Õâ¸öÀà.
3.È»ºóÔÚoracleÖз¢²¼java³ÌÐò:
create or replace function hello (name VARCHAR2) return VARCHAR2
as language java name
'Main.sayHello (java.lang.String) return java.lang.String ';
Ö´ÐÐ:
select hello(' world! ') from dual;
Ìáʾ:ORA-29541: ÎÞ·¨½âÎöÀà SYS.Main.
ÇëÖ¸½Ì.
ÎÊÌâÊÇÎÒµ¼ÈëÁËjar°ü.È»ºóÔõô"ÉèÖÃ"²ÅÄÜÈÃÎÒÀ´ÒýÓÃÕâ¸ö°üÄØ?¡¡
¸øÄã¸öÀý×Ó£º
ÏÖÔÚ,10G¼°ÆäÒÔºó°æ±¾µÄOracleÊý¾Ý¿âÌṩÁ˶ÔJava³ÌÐòµÄ¸ü¶àµÄÖ§³Ö,ºÜºÃµÄ½â¾öÁËÕâ·½ÃæµÄÎÊÌâ. ½â¾ö·½·¨ÈçÏÂ,
1. Ê×ÏÈÎÒÃÇ´´½¨µ÷ÓòÙ×÷ϵͳÃüÁîµÄJava·½·¨
create or replace and compile java source named oscmd as
import java.io.*;
import java.lang.*;
public class OSCmd extends Object {
public static int OSCmd(String args) {
Runtime rt = Runtime.getRuntime();
int rc = -1;
try
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÓÃÔ¶³Ì×ÀÃæÁ¬²Ù×÷·þÎñÆ÷ÉϵÄÊý¾Ý¿â¡£
ÔÚ´´½¨Ò»¸öÓû§Ö®ºó£¬ÔÙÓÃPLSQLµÇ¼£¬ÔòPLSQLËÀµôÁË¡£
ÎҹصôPLSQLÖ®ºó£¬ÓÃÆäËûÓû§Ò²²»ÄܵǼ¡£
ÎÒ°ÑoracleµÄ·þÎñÍ£Ö¹£¬½á¹û¾ÍÊÇoracleµÄ·þÎñ״̬¾ÍÍ£ÁôÔÚ¡°Í ......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
¸÷·´óÏÀ¸ø¸ö˼·£¬²»ÊÇÔÚÏßµÄÄÇÖÖ£¬¾ÍÊÇÒ»¸ö×öÆÕͨµÄÓ¦ÓóÌÐò¡£
´Ê¿âÔõôÉú³ÉÄØ£¿
²»»á¡£
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
ÕÒ±¾×Öµä
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
Êý¾Ý¿â ºÇºÇ
ÓÃmap ¼üÖµ¶ÔÓ¦
Èç¹ûÓÃÊý¾Ý¿ ......