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

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

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

    posts - 495,  comments - 11,  trackbacks - 0

    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);

    8.access數據庫直連用ODBC的

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
    String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");
    Connection conn = DriverManager.getConnection(url,"","");
    Statement stmtNew=conn.createStatement() ;

    posted on 2007-05-25 23:00 jadmin 閱讀(74) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 久久亚洲色WWW成人欧美| 一级一看免费完整版毛片| 亚洲综合校园春色| 边摸边脱吃奶边高潮视频免费| 亚洲日韩在线观看免费视频| 91免费人成网站在线观看18| 日韩一区二区三区免费体验| 亚洲精品人成在线观看| 污视频网站免费观看| 91在线视频免费91| 亚洲人成网77777亚洲色| 亚洲av日韩aⅴ无码色老头| 免费特级黄毛片在线成人观看| 亚洲AV无码一区二区乱孑伦AS| 亚洲中文无码mv| 每天更新的免费av片在线观看| 亚洲精品456播放| 色欲色欲天天天www亚洲伊| 免费一级成人毛片| 亚洲欧洲日韩综合| 无码一区二区三区免费| 中文字幕在亚洲第一在线| 亚洲Av永久无码精品一区二区| 国产99视频精品免费视频7| 亚洲欧美第一成人网站7777 | 亚洲午夜久久久精品影院| 91精品视频在线免费观看| 久久久久国产亚洲AV麻豆| 国产午夜精品久久久久免费视| 亚洲国产成人精品女人久久久 | jzzjzz免费观看大片免费| 亚洲av综合avav中文| 男女免费观看在线爽爽爽视频 | 久久伊人免费视频| 亚洲尤码不卡AV麻豆| 13一14周岁毛片免费| 亚洲精品久久久久无码AV片软件| 国产成人精品免费视频网页大全| 亚洲精品中文字幕无码A片老| 亚洲人成电影在线播放| 亚洲综合免费视频|