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
Ïà¹ØÎĵµ£º
ÉñÃØµÄ ORACLE DUAL±í
DUAL ? ÓÐʲôÉñÃØµÄ? µ±ÄãÏëµÃµ½ORACLEϵͳʱ¼ä, ¼ò¼òµ¥µ¥ÇÃÒ»ÐÐSQL¡¡
¡¡¡¡
¡¡¡¡²»¾ÍµÃÁËÂð? ¹ÊŪÐþÐé….¡¡
¡¡¡¡
¡¡¡¡SQL> select sysdate from dual;¡¡
¡¡¡¡
¡¡¡¡SYSDATE¡¡
¡¡¡¡
¡¡¡¡———¡¡
¡¡¡¡
¡¡¡¡28-SEP-03¡ ......
ÎÒÏÖÔÚÏëʵÏÖÒ»¸öÅжÏORACLEÖÐÒ»¸öÊÓͼÊÇ·ñ´æÔÚ£¬Èç¹û´æÔÚ¾Íɾ³ý¡£
ÔÚ³ÌÐòÖÐÎÒÕâÑùдµÄ:
try
{
#pragma region [ɾµôÀϵÄÊÓͼ]
csSqlText.Format("SELECT COUNT(*) AS ÊÓͼ¼ÆÊý from SYS.ALL_VIEWS WHERE VIEW_NAME='%s';",csViewName);
if (!dbcontroler.Connect_to((_bstr_t)m ......
ʹÓÃCodeSmithÉú³ÉoracleÊý¾Ý¿â±íµÄʵÌå²ã(Model)
http://blog.csdn.net/dacong/archive/2009/01/27/3853663.aspx
×Ô¼ºÐ´µÄ£¬CodeSimthÖеÄÀý×Ó¶¼ÊÇmsSQL serverµÄ£¬ËùÒÔ×Ô¼ºÐ´Á˸öÖ§³ÖOracleÊý¾Ý¿â±íµÄ£¬²»Ò»¶¨ºÜÍêÉÆ£¬ÊÊÓþͺã¬Êý¾ÝÀàÐÍûÓÐÖÜÈ«¿¼ÂÇ£¬Ö»¿¼ÂÇÁ˳£ÓõÄһЩÀàÐÍ£¬Ôö¼ÓÁ˸ö±íÃû×ÖÊôÐÔ£¬²ÉÓõÄ.net2.0ÎÒ½á ......
ORACLE 10GÔÚLINUXµÄ°²×°:
ÏÈÉÏÀ´Á½ÕÅͼ:
DBAÊÇŬÁ¦µÄ·½Ïò,ORACLE DBA°üÂÞÍòÏó,Á¬LINUX/UNIX¶¼¸ã²»¶¨,»¹ÅªP¸öORACLE°¡.
Á½²¿·Ö:
1.RED HAT ENTERPRISE LINUX 5µÄ°²×°
Äѵã(¶ÔÓÚÏÖÔÚµÄÎÒÀ´Ëµ):1.1YUM±¾µØÔ´µÄÅäÖÃ;ÍøÂçÓÐÏà¹Ø×ÊÁÏ,²»¶à˵ÁË.ÓÉÓÚÊDZ¾»úʹÓÃ,²Î¿¼ÁËFTPÔ´ºó,ÎÒʹÓÃÁËFILEÔ´;
&nb ......