Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaµ÷ÓÃoracle´æ´¢¹ý³Ì

//¿´¿´ÈçºÎ±àдһЩ¸´ÔӵĴ洢¹ý³Ì
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
ΪÁËÑéÖ¤£¬ÎÒÏÈ´´½¨Ò»ÕŲâÊÔ±í
create table mytest(myid varchar2(30),myname varchar2(50));
´æ´¢¹ý³ÌΪ£º
create or replace PROCEDURE mytest2(id in varchar2,name in varchar2)  as
begin
   insert into mytest (myid,myname) values(id, name);
end;
/
È»ºóÄØ£¬ÔÚjavaÀïµ÷ÓÃʱ¾ÍÓÃÏÂÃæµÄ´úÂ룺
package com.hyq.src;
import java.sql.*;
import java.sql.ResultSet;
public class TestProcedureOne {
  public TestProcedureOne() {
  }
  public static void main(String[] args ){
    String driver = "oracle.jdbc.driver.OracleDriver";
    String strUrl = "jdbc:oracle:thin:@127.0.0.1:1521:HUAYU";
    Statement stmt = null;
    ResultSet rs = null;
    Connection conn = null;
    //CallableStatement:ÓÃÓÚÈ¥µ÷Óô洢¹ý³Ì
    CallableStatement cstmt = null;
    try {
      Class.forName(driver);
      conn =  DriverManager.getConnection(strUrl, "scott", "tiger");
      CallableStatement proc = null;
      proc = conn.prepareCall("{ call mytest2(?,?)}");
 //¸ø?ºÅ¸³Öµ
      proc.setString(1, "100");
      proc.setString(2, "user1");
 //Ö´Ðд洢¹ý³Ì
      proc.execute();
    }
    catch (Exception ex2) {
 ex2.printStackTrace();    
    }
    finally{
      //¹Ø±Õ×ÊÔ´..
    }
  }
}
µ±È»ÁË£¬Õâ¾ÍÏÈÒªÇóÒª½¨ÕűíTESTTB,ÀïÃæÁ½¸ö×ֶΣ¨I_ID£¬I_NAME£©¡£
¶þ£ºÓзµ»ØÖµµÄ´æ´¢¹ý³Ì£¨·ÇÁÐ±í£©
´æ´¢¹ý³ÌΪ£º
CREATE OR REPLACE PROCEDURE mytest3(id in varchar2,name out varchar2)  as
BE


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

oracle ²é¿´Ö÷Íâ¼üÔ¼Êø

select a.constraint_name, a.table_name, b.constraint_name 
from user_constraints a, user_constraints b
where a.constraint_type = 'R' 
and b.constraint_type = 'P' 
and a.r_constraint_name = b.constraint_name
P ´ú±íÖ÷¼ü
R ´ú±íÍâ¼ü
ͨ¹ý¹ØÁª£¬Äܲéѯµ½ÄãËùÏëÒªµÄÒ»ÇС£
select co ......

oracleº¯ÊýÏê½â

1¡¢SQL Óï¾ä»ù´¡
ÏÂÃæ¸ø³öSQLÓï¾äµÄ»ù±¾½éÉÜ¡£
1.1¡¢SQLÓï¾äËùÓ÷ûºÅ
²Ù×÷·û ÓÃ; Àý×Ó
+ - ±íʾÕýÊý»ò¸ºÊý£¬ÕýÊý¿Éʡȥ + -1234.56
+ ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà¼Ó A=c+b
- ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà¼õ 34-12
* ½«Á½¸öÊý»ò±í´ïʽ½øÐÐÏà³Ë 12*34
/ ³ýÒÔÒ»¸öÊý»ò±í´ïʽ 18*11
NULL ¿ÕÖµÅÐ¶Ï Where name is null; ......

oracleÖÐÖ±½ÓÐ޸ıíÁеÄÃû³ÆºÍ˳Ðò

µ¼ÈëÊý¾ÝµÃʱºò£¬Óöµ½Ò»¸öÎÊÌ⣬Ïë°ÑÁÐÃû˳Ðò¸Ä±äһϡ£ÔÚÍøÉÏËÑË÷µ½ÕâÆªÎÄÕ£¬Ã»È¥ÊÔÑé¡£ÌùÉÏÀ´£¬ÒÔºóÓлú»áÊÔÑéÏ¡£
£¨http://www.im80hou.com/html/oracle/2009/0710/712.html£©
 
°´ÕÕ¹ØÏµÊý¾Ý¿âµÄÀíÂÛ£¬ÐÐÓëÁж¼ÊÇÎÞÐòµÄ£¬µ«ÔÚʵ¼ÊÓ¦ÓÃÖÐÓÐʱÐèҪȷ¶¨ÁеÄ˳Ðò¡£µ«ÔÚOracleÖУ¬Ò»µ©±í¶¨ÒåºÃ£¬ÔÙÏëÐÞ¸ÄÁеÄ˳Ðò¿ ......

Oracle dataguardÅäÖÃStep by Step

Ò»¡¢×¼±¸¹¤×÷
1.1 ÉèÖÃÖ÷¿âµÄforce loggingģʽ
SQL> alter database force logging;
Database altered.
1.2 ´´½¨Ö÷¿âÃÜÂëÎļþ
$ orapwd file=orapw$ORACLE_SID password=thunis entries=4
1.3 ÅäÖÃÖ÷¿âstandby redo log£¬²¢ÑéÖ¤½á¹û
SQL> alter database add standby logfile group 4('/u01/app/oradata/guar ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ