創(chuàng)造希望
          做一個精通技術(shù)的高級管理人員,做一個善於管理的高級技術(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) 評論(0)  編輯  收藏 所屬分類: oracle

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


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

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

          常用鏈接

          留言簿(1)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 榆树市| 长兴县| 清苑县| 江永县| 连州市| 肇源县| 澄江县| 靖州| 商城县| 榕江县| 伊金霍洛旗| 玉树县| 深水埗区| 湖州市| 富阳市| 汝阳县| 冷水江市| 陆河县| 耒阳市| 启东市| 晋州市| 延长县| 肇庆市| 泰顺县| 读书| 蒙山县| 德保县| 新昌县| 南江县| 张家港市| 阳原县| 长岛县| 山阳县| 延津县| 罗平县| 乌拉特前旗| 常宁市| 镇远县| 土默特右旗| 桂林市| 大邑县|