<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    世界因你而精彩___vv

    要么忙著生存,要么趕著去死!人總是要做點什么的!

     

    Java連接各種數據庫的實例

    1、Oracle8/8i/9i數據庫(thin模式)

                

    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

    String url="jdbc:oracle:thin:@localhost:1521:orcl";

    //orcl為數據庫的SID

    String user="test";

    String password="test";

    Connection conn= DriverManager.getConnection(url,user,password);



    2、DB2數據庫

                

    Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance();

    String url="jdbc:db2://localhost:5000/sample";

    //sample為你的數據庫名

    String user="admin";

    String password="";

    Connection conn= DriverManager.getConnection(url,user,password);



    3、Sql Server7.0/2000數據庫

                

    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

    String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";

    //mydb為數據庫

    String user="sa";

    String password="";

    Connection conn= DriverManager.getConnection(url,user,password);



    4、Sybase數據庫

                

    Class.forName("com.sybase.jdbc.SybDriver").newInstance();

    String url =" jdbc:sybase:Tds:localhost:5007/myDB";

    //myDB為你的數據庫名

    Properties sysProps = System.getProperties();

    SysProps.put("user","userid");

    SysProps.put("password","user_password");

    Connection conn= DriverManager.getConnection(url, SysProps);



    5、Informix數據庫

                

    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為數據庫名

    Connection conn= DriverManager.getConnection(url);



    6、MySQL數據庫

                

    Class.forName("org.gjt.mm.mysql.Driver").newInstance();

    String url ="jdbc:mysql://localhost/myDB?

    user=soft&password=soft1234&useUnicode=true&characterEncoding=8859_1"

    //myDB為數據庫名

    Connection conn= DriverManager.getConnection(url);



    7、PostgreSQL數據庫

                

    Class.forName("org.postgresql.Driver").newInstance();

    String url ="jdbc:postgresql://localhost/myDB"

    //myDB為數據庫名

    String user="myuser";

    String password="mypassword";

    Connection conn= DriverManager.getConnection(url,user,password);



    要么忙著生存,要么趕著去死!人總是要做點什么的!

    posted on 2008-01-03 17:29 vv 閱讀(248) 評論(0)  編輯  收藏 所屬分類: DB


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


    網站導航:
     

    導航

    統計

    常用鏈接

    留言簿(2)

    隨筆分類(4)

    隨筆檔案(7)

    文章分類(10)

    文章檔案(11)

    相冊

    最新隨筆

    搜索

    最新評論

    • 1.?re: 過濾頁面中沒有用到的圖片[未登錄]
    • 在非洲,瞪羚每天早上醒來時,他知道自己必須跑的比最快的獅子還快,否則就會被吃掉.獅子每天早上醒來時,他知道自己必須追上跑得最慢的瞪羚,否則就會被餓死.不管你是獅子還是瞪羚,當太陽升起時,你最好開始奔跑
    • --Eleven

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产亚洲综合精品一区二区三区| 亚洲Av无码一区二区二三区| 特级毛片全部免费播放a一级| 日韩成人免费在线| 欧美色欧美亚洲另类二区| 永久黄网站色视频免费直播| 亚洲欧美日韩中文二区| 成人免费在线视频| 午夜亚洲国产理论片二级港台二级| 免费看片免费播放| 美国免费高清一级毛片| 亚洲无码精品浪潮| 国产成人无码区免费内射一片色欲 | 亚洲国产美女视频| 久久国内免费视频| 2017亚洲男人天堂一| 在线观看免费a∨网站| 精品在线免费视频| 亚洲日韩aⅴ在线视频| 久久国产精品成人免费| 亚洲欧洲国产成人精品| 免费看片A级毛片免费看| 一级免费黄色大片| 亚洲国产精品线在线观看| 日韩视频在线精品视频免费观看| 亚洲中文无码亚洲人成影院| 免费观看国产小粉嫩喷水| 色播在线永久免费视频网站| 久久久亚洲裙底偷窥综合| 色妞WWW精品免费视频| 九九久久精品国产免费看小说| 久久亚洲国产午夜精品理论片| 精品久久久久成人码免费动漫 | 国产h视频在线观看免费| 亚洲精品亚洲人成在线| av在线亚洲欧洲日产一区二区| 无码精品国产一区二区三区免费| 亚洲中文字幕一二三四区| 亚洲一区二区三区自拍公司| 黄在线观看www免费看| 高潮毛片无遮挡高清免费|