創(chuàng)造希望
          做一個(gè)精通技術(shù)的高級(jí)管理人員,做一個(gè)善於管理的高級(jí)技術(shù)人員!在學(xué)習(xí)中實(shí)踐,在實(shí)踐中學(xué)習(xí)!明日網(wǎng)豪之星
          posts - 5,  comments - 1,  trackbacks - 0

          1、Oracle8/8i/9i數(shù)據(jù)庫(thin模式)
          Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
          String url="jdbc:oracle:thin:@localhost:1521:orcl";
          //orcl為數(shù)據(jù)庫的SID
          String user="test";
          String password="test";
          Connection conn= DriverManager.getConnection(url,user,password);

          2、DB2數(shù)據(jù)庫
          Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();
          String url="jdbc:db2://localhost:5000/sample";
          //sample為你的數(shù)據(jù)庫名
          String user="admin";
          String password="";
          Connection conn= DriverManager.getConnection(url,user,password);

          3、Sql Server7.0/2000數(shù)據(jù)庫
          Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
          String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";
          //mydb為數(shù)據(jù)庫
          String user="sa";
          String password="";
          Connection conn= DriverManager.getConnection(url,user,password);

          4、Sybase數(shù)據(jù)庫
          Class.forName("com.sybase.jdbc.SybDriver").newInstance();
          String url =" jdbc:sybase:Tds:localhost:5007/myDB";
          //myDB為你的數(shù)據(jù)庫名
          Properties sysProps = System.getProperties();
          SysProps.put("user","userid");
          SysProps.put("password","user_password");
          Connection conn= DriverManager.getConnection(url, SysProps);

          5、Informix數(shù)據(jù)庫
          Class.forName("com.informix.jdbc.IfxDriver").newInstance();
          String url =
          "jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver;
          user=testuser;password=testpassword";
          //myDB為數(shù)據(jù)庫名
          Connection conn= DriverManager.getConnection(url);

          6、MySQL數(shù)據(jù)庫
          Class.forName("org.gjt.mm.mysql.Driver").newInstance();
          String url ="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicod
          e=true&characterEncoding=8859_1"
          //myDB為數(shù)據(jù)庫名
          Connection conn= DriverManager.getConnection(url);

          7、PostgreSQL數(shù)據(jù)庫
          Class.forName("org.postgresql.Driver").newInstance();
          String url ="jdbc:postgresql://localhost/myDB"
          //myDB為數(shù)據(jù)庫名
          String user="myuser";
          String password="mypassword";
          Connection conn= DriverManager.getConnection(url,user,password);

          posted on 2007-12-03 14:48 網(wǎng)豪 閱讀(110) 評(píng)論(0)  編輯  收藏 所屬分類: oracle

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

          <2025年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊(cè)

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 长宁区| 承德县| 育儿| 睢宁县| 长宁县| 南澳县| 绥宁县| 平远县| 许昌市| 阿拉善右旗| 新田县| 冀州市| 南康市| 长武县| 双牌县| 开阳县| 温泉县| 扶风县| 黔南| 安图县| 荥阳市| 改则县| 清流县| 信宜市| 甘孜县| 康乐县| 民勤县| 安仁县| 新郑市| 砀山县| 高清| 丹棱县| 开化县| 延庆县| 红桥区| 马山县| 迁安市| 垦利县| 九龙城区| 自治县| 信阳市|