jdbcÖе÷ÓÃoracle´æ´¢¹ý³Ì
1¡¢´´½¨±í£º
create table stud(
sid int,
sname varchar2(50)
)
²¢²åÈëÒ»ÌõÊý¾Ý
insert into stud values(1,'Tom')
2¡¢´´½¨´æ´¢¹ý³Ì
--´´½¨´æ´¢¹ý³Ì
create or replace procedure pro_select_name(
v_sid in stud.sid%type,
v_sname out stud.sname%type
)
--ÉùÃ÷Çø
is
--Ö´ÐÐÌå
begin
select sname into v_sname from stud where sid = v_sid;
--Òì³£´¦Àí
exception
when others then
dbms_output.put_line(sqlcode||sqlerrm);
end;
3¡¢jdbcÖе÷ÓÃ
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Types;
public class TestPro {
public void test(){
Connection con = null;
CallableStatement cst = null;
try{
 
Ïà¹ØÎĵµ£º
¹ØÓÚOracleµÄsession
1.ÈçºÎ²é¿´session¼¶µÄµÈ´ýʼþ£¿
µ±ÎÒÃǶÔÊý¾Ý¿âµÄÐÔÄܽøÐе÷Õûʱ£¬Ò»¸ö×îÖØÒªµÄ²Î¿¼Ö¸±ê¾ÍÊÇϵͳµÈ´ýʼþ¡£$system_event,v$session_event,v$session_waitÕâÈý¸öÊÓͼÀï¼Ç¼µÄ¾ÍÊÇϵͳ¼¶ºÍsession¼¶µÄµÈ´ýʼþ£¬Í¨¹ý²éѯÕâЩÊÓͼÄã¿ÉÒÔ·¢ÏÖÊý¾Ý¿âµÄһЩ²Ù×÷µ½µ×ÔÚµÈ ......
ÊÓͼ
´´½¨ÐÂ±í£ºcreate table emp2 as select * from emp;
create view empv20 as select empno,ename,job,hiredate,deptno from emp where deptno=20 with check option;
Óï·¨£ºcreate or replace view ÊÓͼÃû³Æ as ×Ó²éѯ£¨ÐÞ¸ÄÖ®ºóµÄ×Ó²éѯ£©
Ìæ»»ÊÓͼ(ÐÞ¸Ä)
create or replace view empv20 as select empno,ename, ......
1. ½âÊÍÀ䱸·ÝºÍÈȱ¸·ÝµÄ²»Í¬µãÒÔ¼°¸÷×ÔµÄÓŵã
½â´ð£ºÈȱ¸·ÝÕë¶Ô¹éµµÄ£Ê½µÄÊý¾Ý¿â£¬ÔÚÊý¾Ý¿âÈԾɴ¦ÓÚ¹¤×÷״̬ʱ½øÐб¸·Ý¡£¶øÀ䱸·ÝÖ¸ÔÚÊý¾Ý¿â¹Ø±Õºó£¬½øÐб¸·Ý£¬ÊÊÓÃÓÚËùÓÐģʽµÄ
Êý¾Ý¿â¡£Èȱ¸·ÝµÄÓŵãÔÚÓÚµ±±¸·Ýʱ£¬Êý¾Ý¿âÈԾɿÉÒÔ±»Ê¹Óò¢ÇÒ¿ÉÒÔ½«Êý¾Ý¿â»Ö¸´µ½ÈÎÒâÒ»¸öʱ¼äµã¡£À䱸·ÝµÄÓŵãÔÚÓÚËüµÄ±¸·ÝºÍ»Ö¸´
²Ù×÷Ïൠ......
£¨´ËƪÎÄÕÂÖ»ÐèÒªÁ˽â¼È¿ÉÒÔÁË£©
ǶÌ×±í
¶¨Ò壺ÔÚÒ»¸ö±íÖл¹°üº¬ÁíÍâÒ»¸ö×Ó±í¡£
Êý¾Ý¿âÔÚ´´½¨Êý¾Ý±íµÄʱºò¶¼ÒªÖ¸¶¨×ֶεÄÀàÐÍ£¬ËùÒÔǶÌ×±í±¾ÉíÒ²ÐèҪͬÑùÖ¸¶¨ÀàÐÍ£¬ËùÒÔÕâÖÖÀàÐÍÐèÒªµ¥¶À¶¨Òå¡£
´´½¨ÀàÐÍÓï·¨£ºcreate type project_ty as object£¨
......
£¨1£©oracleÊý¾Ý¿â±¸·ÝµÄµ¼Èë¶ÔÊý¾Ý¿âµÄ°æ±¾ÓÐÒªÇó£¬Ò²¼´Ô´Êý¾Ý¿â£¨µ¼³ö²úÉú±¸·ÝµÄÊý¾Ý¿â£©µÄ°æ±¾ÒªºÍÄ¿±êÊý¾Ý¿â£¨µ¼ÈëÊý¾Ý¿â£©µÄ°æ±¾Ò»Ö£¬·ñÔò¿ÉÄܵ¼Öµ¼Èëʧ°Ü¡£
£¨2£©±¸·ÝÖеÄÓû§Ãû£¨Êý¾Ý¿âµ¼³öʱËùʹÓõÄÓû§£©ºÍµ¼ÈëÊý¾Ý¿âµÄÓû§Ãû×îºÃÒ»Ñù£¬ÒòΪÓû§ÃûºÍ±í¿Õ¼äÃüÃûÓйØÏµ£¬Èç¹û²»Ò»Ñù£¬µ¼Èë¾Í²»ÄÜÒ»´ÎÍê³É¡£Ò²¾ÍÊÇ ......