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.
Ïà¹ØÎĵµ£º
¹ú¶¼ºÅÂëÊý¾Ý¿âÉè¼Æ˵Ã÷
V1
Îĵµ±ä¸ü¼Ç¼
ÐòºÅ
±ä¸üÄÚÈÝ˵Ã÷
°æ±¾ºÅ
°æ±¾ÈÕÆÚ
Ö´±ÊÈË
1
³õ¸å
V ......
ORACLEÅàѵ(OCA)ÈÏÖ¤½éÉÜ
Oracle10g Certified Associate (OCA) Oracle ÈÏ֤רԱ¡£
¿¼ÊԳɼ¨Í¨¹ýÄÜ»ñµÃOracle¹«Ë¾ÎªÄú°ä·¢µÄÈ«ÇòÈÏÖ¤µÄÓ¢ÎÄOCAÖ¤Êé¡£OCAÓÉOracle¹«Ë¾³öÌâ¡£
¸ÃÖ¤Êé¿É×÷Ϊ¸÷ÆóÊÂÒµµ¥Î»Êý¾Ý¿â¹ÜÀíÈËÔ±ÉϸڵÄÒÀ¾Ý¡£
Ä¿Ç°ÒѳÉΪ¸÷IT¹«Ë¾¼°Ïà¹ØÆóÒµÕùÏྺƸµÄÊý¾Ý¿â¹ÜÀíά»¤È˲ţ¬ÊÇÊý¾Ý¿âά»¤¹ÜÀíÈËÔ ......
ÓеÄÇé¿öÏ£¬ÎÒÃÇÐèÒªÓõݹéµÄ·½·¨ÕûÀíÊý¾Ý£¬Õâ²Å³ÌÐòÖкÜÈÝÒ××öµ½£¬µ«ÊÇÔÚÊý¾Ý¿âÖУ¬ÓÃSQLÓï¾äÔõôʵÏÖ£¿ÏÂÃæÎÒÒÔ×îµäÐ͵ÄÊ÷ÐνṹÀ´ËµÃ÷ÏÂÈçºÎÔÚOracleʹÓõݹé²éѯ¡£
ΪÁË˵Ã÷·½±ã£¬´´½¨Ò»ÕÅÊý¾Ý¿â±í£¬ÓÃÓÚ´æ´¢Ò»¸ö¼òµ¥µÄÊ÷Ðνṹ
Sql´úÂë
create table TEST_TREE
( &n ......
ÒÔϵÄÎÄÕÂÖ÷Òª½²ÊöµÄÊÇOracleɾ³ýÓû§±íµÄʵ¼Ê²Ù×÷·½°¸£¬±¾ÎÄÖ÷ÒªÊÇÒÔÏà¹Øʵ¼ÊÓ¦ÓôúÂëµÄ·½Ê½À´Òý³öÆäʵ¼ÊµÄ²Ù×÷²½Ö裬ÒÔϾÍÊÇÎÄÕµľßÌåÄÚÈÝÃèÊö£¬ÍûÄãÔÚä¯ÀÀÖ®ºó»áÓÐËùÊÕ»ñ¡£
1.
select 'Drop table '||table_name||';' from all_tables where owner='Ҫɾ³ýµÄÓû§Ãû£¨×¢ÒâÒª´óд£©';
2.Oracleɾ³ýÓû§±í ÒÔÓ ......
Access¡¢SQLServer¡¢Oracle³£¼ûSQLÓï¾äÓ¦ÓÃÇø±ð
¹Ø¾¢ËÉ PMP
Èç¹ûÒª¼æÈÝAccess¡¢SQL Server¡¢OracleÈý¸öÊý¾Ý¿â°æ±¾£»ÎÒÃÇÔÚ±àдSQLÓï¾äµÄ¹ý³ÌÖУ¬¾¡Á¿Ê¹ÓÃһЩͨÓõÄÓï¾ä£¬µ«»¹ÊÇÓÐЩ·½ÃæÓÐЩÇø±ð±ÜÃâ²»ÁË£¬ÏÖ¼òµ¥×ܽáһϡ£
ÒÔÏÂA´ú±íAccess,S´ú±íSQL Server,O´ú±íOracle
1¡¢È¡µ±Ç°ÏµÍ³Ê±¼ä
A:Select Now()
S:Selec ......