oracleºÍMysqlÁ¬½ÓÊý¾Ý¿â
Mysql·½Ê½£º
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MysqlDB {
private String strClass = "com.mysql.jdbc.Driver";
private String strDriver = "jdbc:mysql://localhost:3306/s_smdb";
private String strUser = "root";
private String strPwd = "123";
private Connection conn = null;
private Statement stmt = null;
private ResultSet rs = null;
private static CDBAccess instance = null;
private CDBAccess() throws ClassNotFoundException, SQLException{
Class.forName(strClass);
conn = DriverManager.getConnection(strDriver,strUser,strPwd) ;
}
public static CDBAccess getInstance() throws ClassNotFoundException, SQLException{
if(instance == null){
instance = new CDBAccess();
}
return instance;
}
public ResultSet executeQuery(String strsql) throws SQLException{
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery(strsql);
return rs;
}
public int executeUpdate(String strsql) throws SQLException{
int i = 0;
stmt = conn.createStatement();
i = stmt.executeUpdate(strsql);
return i;
}
public void close() throws SQLException{
if(rs != null){
rs.close();
}
if(stmt != null){
stmt.close();
}
if(conn != null){
conn.close();
}
if(instance != null){
instance = null;
}
}
}
Oracle·½Ê½£º
package util;
import java.sql.Connection;
import java.sql.
Ïà¹ØÎĵµ£º
apacheµÄ¾²Ì¬/¶¯Ì¬±àÒëÔÚapache+php+mysqlµÄÓ¦ÓÃ
ÎÒÏë´ó¼ÒÓв»ÉÙ¶¼³É¹¦ÊµÏÖapache+php+mysql£¬ÍøÉϵÄÎÄÕÂÒ²Óв»ÉÙ£¬µ«ÎÒ·¢ÏÖ²»ÉÙÎÄÕ¶¼ÊdzÀ´³È¥£¬²¢ÇÒ
ûÓÐ˵Ã÷°×±àÒëµÄ·½Ê½£¬ÓеÄË÷ÐÔapache1.3µÄ±àÒë·½·¨Ô·â²»¶¯µÄ°á¹ýÀ´Ì×ÔÚapache2.0£¬ÏÔÈ»Îóµ¼Ò»Ð©²ËÄñ £¡
ÎÒ½ñÌì¾ÍÒÔapache+mysql+php˵һϾ²Ì¬±àÒëºÍDSO¶¯Ì¬±à ......
1¡¢´Ó±íÖÐËæ»úÈ¡¼Ç¼
select * from (select * from staff order by dbms_random.random)
where rownum < 4
±íʾ´ÓSTAFF±íÖÐËæ»úÈ¡3Ìõ¼Ç¼
2¡¢²úÉúËæ»úÊý
SELECT DBMS_RANDOM.RANDOM from DUAL;
  ......
³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ£º
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRows¡£
2¡¢ÏÈÖ´ÐÐ EXPLAIN PLAN FOR select * from tableA ......
ORACLEÅàѵ(OCA)ÈÏÖ¤½éÉÜ
Oracle10g Certified Associate (OCA) Oracle ÈÏ֤רԱ¡£
¿¼ÊԳɼ¨Í¨¹ýÄÜ»ñµÃOracle¹«Ë¾ÎªÄú°ä·¢µÄÈ«ÇòÈÏÖ¤µÄÓ¢ÎÄOCAÖ¤Êé¡£OCAÓÉOracle¹«Ë¾³öÌâ¡£
¸ÃÖ¤Êé¿É×÷Ϊ¸÷ÆóÊÂÒµµ¥Î»Êý¾Ý¿â¹ÜÀíÈËÔ±ÉϸڵÄÒÀ¾Ý¡£
Ä¿Ç°ÒѳÉΪ¸÷IT¹«Ë¾¼°Ïà¹ØÆóÒµÕùÏྺƸµÄÊý¾Ý¿â¹ÜÀíά»¤È˲ţ¬ÊÇÊý¾Ý¿âά»¤¹ÜÀíÈËÔ ......
ÖØ×°²Ù×÷ϵͳºó,Èç¹ûÊý¾ÝÎļþ,¿ØÖÆÎļþ,ÈÕÖ¾Îļþ¶¼ÍêºÃµÄ»°(ÔÚitpub¿´¹ýºÜ¶àÈËÌá¹ýÕâ¸ö»°Ìâ,¶àÊýÈ˶¼Êǽ«Õâ3¸öÎļþ·ÅÔÚͬһĿ¼oradata),Ö»ÐèÖØа²×°oracle(¸úÖØ×°²Ù×÷ϵͳǰͬ°æ±¾)µ½ÔĿ¼ºó,Öؽ¨ÊµÀý·þÎñºÍÃÜÂëÎļþ,ÅäÖÃÒ»ÏÂlistenerºÍtns¼´¿ÉÕý³£Æô¶¯Êý¾Ý¿â.
¹ý³ÌÈçÏÂ(¼ÙÉèÔʵÀýÃûΪorcl,°æ±¾Îª9i):
1.½«ÔÀ´µÄor ......