JAVA Á¬½ÓORACLEÊý¾Ý¿â´úÂë
import java.net.url;
import java.sql.*;
public class javaoracle {
public javaoracle() {
}
public static void main(string[] args){
try
{
try{
class.forname("oracle.jdbc.driver.oracledriver");
}
catch(java.lang.classnotfoundexception e)
{
system.err.print(e.getmessage());
}
string url="jdbc:oracle:thin:@server:1521:sdcdb";
connection conn=drivermanager.getconnection(url,"test","test");
statement stmt=conn.createstatement();
resultset rs=stmt.executequery("select score from my");
while(rs.next())
{
system.out.println(rs.getstring(1));
}
conn.close();
}
catch(sqlexception ex)
{
while(ex!=null)
{system.out.println(ex.getsqlstate());
}
}
}
}
///////////////////////
ÔÚtry{}ÖУº Class.forName("oracle.jdbc.driver.OracleDriver");
//½«OracleDriverÔØÈëJVM¶ÔÏó³Ø
Å׳ö£ºClassNotFoundException
3.Á¬½ÓÊý¾Ý¿â£º Connection con=DriverManager.getConnection("jdbc:oracle:thin:ordertemp/ordetemp@localhost:1521:GY");
Êý¾Ý¿âÀàÐͱêʶ·û£º jdbc:odbc:thin
µÇ½Óû§Ãû£º ordertemp
µÇ½ÃÜÂ룺 ordertemp
Êý¾Ý¿â·þÎñÆ÷IPµØÖ·£ºlocalhost (»òÕßÓÃ127.0.0.1£¬Èç¹ûÊÇÍøÂ磬ÔòΪURL)
Êý¾ÝÐéÄâ¶Ë¿ÚºÅ£º 1521 (oracleĬÈ϶˿ںÅ) //(sqlserverĬÈ϶˿ںÅ1433)
Êý¾Ý¿âSID£º GY
Å׳ö£ºSQLException
4.´´½¨Statement¶ÔÏó£¨PreparedStatementÒ²¿ÉÒÔ£©
Statement stm=con.createStatement();
PreparedStatement psm=con.prepareStatement(String sql);
5.Ö´ÐÐÏà¹ØSQL²éѯÓï¾ä¼°»ñµÃ½á¹û¡£
6.½áÊøÖ®ºó£¬±ØÐëʹÓ㺠stm.close();  
Ïà¹ØÎĵµ£º
OracleÖзÖÎö±íµÄ×÷ÓÃ
http://diegoball.javaeye.com/blog/568009
ÎÄÕ·ÖÀà:Êý¾Ý¿â
1.·ÖÎö¸üбíµÄͳ¼ÆÐÅÏ¢,,ÓпÉÄܵ¼ÖÂÖ´Ðмƻ®¸Ä±ä..
2.ÒÔµÄanalyze table abc compute statistics;ÕâÌõΪÀý£¬Éú³ÉµÄͳ¼ÆÐÅÏ¢»á´æÔÚÓÚuser_tablesÕâ¸öÊÓͼ£¬²é¿´Ò»ÏÂselect * from user_tables where table_name='ABC';
¹Û²ìÒ»ÏÂNUM_RO ......
Oracle ±íɾ³ý´óÁ¿Êý¾Ýºó£¬¼´Ê¹±íÖÐÖ»Óм¸ÐмǼ£¬µ«ÓÃselect count(*) from table À´²éѯ·¢¾õ¶¼²»»áÂíÉϳöÀ´£¬ÔÒòÊǸñíµÄ¿Õ¼ä´óÁË£¬²éѯÆðÀ´ºÜÂý¡£½â¾öµÄ·½·¨ÊǰѸñíËùÕ¼Óõıí¿Õ¼äËõС£¬»òÕß˵Êͷűí¿Õ¼ä¡£
alter table XXXX move; ÕâÑù´¦Àíºó¾ÍÊÍ·ÅÁ˱í¿Õ¼äÁË¡£µ«ÊÇÊͷűí¿Õ¼äºó£¬±íµÄÐкÅrowid»á·¢Éú±ä»¯£¬¶ø»ùÓÚ ......
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
²ÎÊý1 IN NUMBER,
²ÎÊý2 IN NUMBER
) IS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
2.SELECT INTO STATEMENT
½«select²éѯµÄ½á¹û´æÈëµ½±äÁ¿ÖУ¬¿ÉÒÔͬʱ½«¶à¸öÁд洢¶à¸ö±äÁ¿Ö ......
###author:hiphop###
###qq:70381908###
ΪʲôҪ¹Ø×¢ Oracle ?
ÒòΪOracle ±»´óÁ¿ÆóÒµËùʹÓÃ,ÓÐÐí¶àÄ¿±ê¿ÉÒÔÑ¡ÔñÀ´Éø͸
Ðí¶àÆóÒµ¶¼Ã»ÓиüÐÂÇÒÓÐDZÔڵķ½ÏÕ!
ÌáȨ·Ç³£¼òµ¥,ÈÝÒ×Äõ½shell!!
¶ÁÁËblackhat paper ÈÃÎÒ¿ªÊ¼À´Ñо¿Oracle
ÒòΪËûÖ»½²µ½Ò»Ð¡²¿·Ý ÕæÕý°²È«ÎÊÌ⻹ÓкܹãµÄ
Ö»ÊǹúÄÚºÃÏñºÜÉÙÍÚ¾ò
ÒòΪÓöµ½ ......