Javaµ÷ÓÃOracleÊý¾Ý¿âµÄ·ÖÒ³´æ´¢¹ý³Ì
×î½üÏîÄ¿½ø¶È±È½Ï»ºÂý£¬³õ²½Ñо¿ÁËÒ»ÏÂOracleµÄ´æ´¢¹ý³Ì£¬½«´úÂëÌù³öÀ´¡£
Ê×ÏÈÏÈÌù³öÀ´OracleµÄ·ÖÒ³·ÖÒ³´æ´¢¹ý³Ì´úÂë°É¡£
1.ÕâÊÇ°üµÄ´úÂë
create or replace package DB_Oper is
-- Author : LIUBING
-- Created : 2009-10-28 15:01:30
-- Purpose : ²âÊÔOracleµÄ·ÖÒ³´æ´¢¹ý³Ì
-- Public type declarations
type ref_DataSet is REF CURSOR;
-- Public function and procedure declarations
function GetCount(mTableName varchar2, mTerm varchar2) return number;
procedure return_DataSet(
mTableName in varchar2, --±íÃû
mTerm in varchar2, --Ìõ¼þ
mPageSize in number, --ÿҳÏÔʾ¼Ç¼Êý
mPageIndex in number, --µ±Ç°Ò³
mOrderField in varchar2, --ÅÅÐò×Ö¶Î
mOrderStyle in number, --ÅÅÐò·½Ê½ 0 ÉýÐò 1 ½µÐò
mTotalRecords out number, --×ܼǼÊý
mDateSet out ref_DataSet --¼Ç¼
);
end DB_Oper;
2.ÕâÊÇ°üÌåµÄ´úÂë
create or replace package body DB_Oper is
----- »ñÈ¡¼Ç¼Êý ------
function GetCount(mTableName varchar2, mTerm varchar2) return number is
i number;
vSql varchar2(1000);
begin
i := 0;
vSql := 'select count(*) from ' || mTableName ;
if length(mTerm) > 0 then
vSql := vSql || ' where ' || mTerm;
end if;
execute IMMEDIATE vSql into i;
return(i);
end;
----- Êý¾Ý·ÖÒ³ ----------
procedure return_DataSet(
&n
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
Ò»¡¢final
¡¡¸ù¾Ý³ÌÐòÉÏÏÂÎÄ»·¾³£¬Java
¹Ø¼ü×ÖfinalÓГÕâÊÇÎÞ·¨¸Ä±äµÄ”»òÕß“ÖÕ̬µÄ”º¬Ò壬Ëü¿ÉÒÔÐÞÊηdzéÏóÀà¡¢·Ç³éÏóÀà³ÉÔ±·½·¨ºÍ±äÁ¿¡£Äã¿ÉÄܳöÓÚÁ½ÖÖÀí½â¶øÐèÒª×èÖ¹¸Ä±ä£ºÉè¼Æ»òЧÂÊ¡£
finalÀ಻Äܱ»¼Ì³Ð£¬Ã»ÓÐ×ÓÀ࣬finalÀàÖеķ½·¨Ä¬ÈÏÊÇfinalµÄ¡£
final·½·¨²»Äܱ»×ÓÀàµÄ·½· ......
»¨ÁË´ó°ëÌìµÄʱ¼äÖÕÓÚ½â¾öÁËÎÊÌ⣬ÏÂÃæ·ÖÏíÒ»ÏÂÎҵĹý³Ì£º
ÎÒµÄϵͳ°²×°µÄÊÇjdk6,netbeansºÍMycrosoft SqlServer 2005£¬javaÁ¬½ÓÊý¾Ý¿âÒ»°ãÒª·ÖÁù²¿×ß
1.×¢²áÇý¶¯
2.ÓÃÇý¶¯¹ÜÀíÀà´´½¨Á¬½Ó
3.´´½¨Óï¾ästatement·â×°sql½Å±¾Óï¾ä
4.Ö´ÐÐ
5.´¦Àí·µ»ØµÄ½á¹û
6.¹Ø±ÕÏà¹ØÁ¬½Ó
ÔÚÕâÀïÁ¬½ÓµÄÊÇSqlServer2005£¬ÊôÓÚµÚÈý·½Çý¶¯ ......