J2EEÓ¦ÓÃÖÐÓëOracleÊý¾Ý¿âµÄÁ¬½Ó
ÔÚJ2EEÓ¦ÓóÌÐò¿ª·¢ÖУ¬Ó¦ÓóÌÐòÓëÊý¾Ý¿âÁ¬½ÓµÄ½¨Á¢ÊÇÎÒÃǾ³£Óöµ½µÄÎÊÌâÖ®Ò»¡£ÔÚÕâÀïÎÒÖ÷Ҫ̸̸ÔÚ±¾µØÓ¦ÓóÌÐòÖÐͨ¹ýOCI·½Ê½¡¢thin·½Ê½ºÍJdbcOdbcÇÅ·½Ê½Á¬½ÓOracleÊý¾Ý¿â£¬ÔÚiPlanet Application Server 6.5ºÍSun Java System Application Server 7ÖжÔOracleÊý¾Ý¿âÁ¬½Ó³ØµÄÅäÖÃÒÔ¼°Ó¦ÓÃÖÐÈçºÎ´ÓÁ¬½Ó³ØÖлñµÃÁ¬½Ó
Ò»¡¢±¾µØͨ¹ýJDBC»ñµÃOracleÊý¾Ý¿âÁ¬½Ó
ͨ¹ýJDBC»ñµÃOracleÊý¾Ý¿âÁ¬½Ó£¬ÓÐÈýÖÖ·½Ê½£ºOCI·½Ê½¡¢thin·½Ê½ºÍJdbcOdbcÇÅ·½Ê½¡£OCI·½Ê½ÒÀÀµÓÚ±¾µØµÄ¶¯Ì¬Á´½Ó¿â£¬Èç¹ûÔÚ±¾µØ°²×°ÁËOracleÊý¾Ý¿â¿Í»§¶Ë¿ÉÒÔ²ÉÓø÷½Ê½£»¶øthin·½Ê½Îª´¿javaµÄÊý¾Ý¿âÁ¬½Ó·½Ê½£»JdbcOdbcÇÅ·½Ê½ÒÀÀµÓÚ±¾µØODBCÊý¾Ý¿âÔ´µÄÅäÖã¬ÕâÖÖ·½Ê½Ò»°ã²»Ì«±»²ÉÓá£
1¡¢OCI·½Ê½
ÏÈÔÚ±¾µØ°²×°Oracle¿Í»§¶Ë£¬°²×°ÍêÖ®ºó£¬ÔÚ°²×°µÄ·¾¶ÖпÉÒÔÕÒµ½…/jdbc/lib/classes12.zipÎļþ£¬ÎÒÃÇÔÚ»·¾³±äÁ¿classpathÖÐÉèÖÃclasses12.zipËùÔڵķ¾¶¡£
È»ºóͨ¹ýÒÔϵÄÊý¾Ý¿âÁ¬½ÓÀ࣬ÔÚ±¾µØͨ¹ýOCI·½Ê½»ñµÃOracleÊý¾Ý¿âÁ¬½Ó
/**
* ÔÚ±¾µØ»ñµÃÊý¾Ý¿âÁ¬½Ó
*/
package com.j2ee.db;
import java.util.*;
import java.sql.*;
import javax.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
import javax.naming.*;
/**
* ͨ¹ýOCI·½Ê½»ñµÃOracleÊý¾Ý¿âÁ¬½Ó
*/
public class DbConnection
{
final static String sDBDriver = "oracle.jdbc.driver.OracleDriver";
final static String sConnStr = "jdbc:oracle:oci8:sr/sr@ora199";
/**
*
*/
public DbConnection()
{
}
/**
* »ñµÃOracleÊý¾Ý¿âÁ¬½Ó
*/
public java.sql.Connection connectDbByOci()
{
java.sql.Connection conn=null;
try
{
Class.forName(sDBDriver);
conn = DriverManager.getConnection(sConnStr);
}
catch (Exception e)
{
System.out.println("ERROR:"+e.getMessage());
}
return conn;
}
}
ÔÚÁ¬½Ó×Ö·û´® "jdbc:oracle:oci8:sr/sr@ora199" ÖУ¬"sr/sr"ΪOracleÓû§µÄÓû§ÃûºÍ¿ÚÁ"ora199"ΪÊý¾Ý¿â·þÎñÃû¡£
2¡¢thin·½Ê½
Ïȵ½Oracle¼¼ÊõÍø£¨http://otn.oracle.com/global/cn/software/tech/java/sqlj_jdbc/index.html£©ÏÂÔØOracle JDBC Drivers£¬Í¬ÑùµØ½«ÏÂÔغóµÄzipÎļþµÄ·¾¶ÉèÖÃÔÚ»·¾³±äÁ¿classpath¡£
È»ºóͨ¹ýÒÔϵÄÊý¾Ý¿âÁ¬½ÓÀ࣬ÔÚ±¾µØͨ¹ýthin·½Ê½»ñµÃOracleÊý¾Ý¿âÁ¬½Ó¡£
/**
* ÔÚ±¾µØ»ñµÃÊý¾Ý¿âÁ¬½Ó
*/
package com.j2ee.db;
import java.
Ïà¹ØÎĵµ£º
SDO_FILTER
¸ñʽ£º
SDO_FILTER(geometry1, geometry2, params);
ÃèÊö£º
ͨ¹ý¿Õ¼äË÷Òý£¬¸ù¾Ý¸ø¶¨µÄ¼¸ºÎÒªËؼìË÷³ö¾ßÓпռäÏ໥¹ØϵµÄ¿Õ¼ä¶ÔÏó¡£ÕâÀïµÄ¿Õ¼ä¹ØϵÊÇÖ¸Á½¸ö¼¸ºÎ²»·ÖÀ룬¼´Non-disjoint¡£¡¾disjoint£º±íʾÁ½¸ö¼¸ºÎµÄ±ßºÍÄÚ²¿¶¼²»Ïཻ¡¿
Õâ¸öSdo_Fi ......
Ò»¡¢Ë÷ÒýÀàÐͼ°½á¹¹£º
oracleµÄË÷Òý·ÖΪ5ÖÖ:ΨһË÷Òý£¬×éºÏË÷Òý£¬·´Ïò¼üË÷Òý£¬Î»Í¼Ë÷Òý£¬»ùÓÚº¯ÊýµÄË÷Òý
Âß¼ÉÏ£º
Single column µ¥ÁÐË÷Òý
Concatenated ¶àÁÐË÷Òý
Unique ΨһË÷Òý
NonUnique ·ÇΨһË÷Òý
Function-basedº¯ÊýË÷Òý
Domain ÓòË÷Òý
ÎïÀíÉÏ£º
Partitioned ·ÖÇøË÷Òý
NonPartitioned ......
shutdown immediate
Ç¿Áв»½¨ÒéתΪ·Ç¹éµµÄ£Ê½
startup mount
alter database noarchivelog
alter database open
·Ç¹éµµ×ª¹éµµ
startup mount
alter database archivelog
alter database open
Ôڹ鵵ÈÕ־ģʽÏ£¬ÓпÉÄÜ»áÓöµ½¹éµµÈÕÖ¾´óС³¬¹ý×î´óÖµ¶ø³öÏÖÌÖÑáµÄORA-00257´íÎó£¬Ç°Ãæ˵ÁËÈçºÎ°Ñ¹éµµÈÕÖ¾¿Õ¼ä±ä´ó¡£¶ ......
create or replace procedure inserttestdata
(
v_count in number,
v_startuserid in varchar2,
v_returnval out number )
as
v_opertime   ......