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

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

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

    posts - 38,  comments - 22,  trackbacks - 0
    數(shù)據(jù)庫連接大全 下面羅列了各種數(shù)據(jù)庫使用JDBC連接的方式,可以作為一個(gè)手冊(cè)使用。
    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&useUnicode=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);

    8、access數(shù)據(jù)庫直連用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() ;
    轉(zhuǎn)貼
    posted on 2006-12-08 10:09 aaabbb 閱讀(262) 評(píng)論(0)  編輯  收藏 所屬分類: DataBase

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


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲va久久久久| 国产成人精品日本亚洲18图| 免费观看又污又黄在线观看| 在线播放免费人成视频在线观看| 黄 色一级 成 人网站免费| 免费jlzzjlzz在线播放视频| 黄网站色成年片大免费高清| 亚洲国产成人久久精品99| 一级毛片免费在线| 国产黄色一级毛片亚洲黄片大全 | 亚洲欧美日韩国产成人| 波多野结衣在线免费视频| 亚洲一区二区久久| 日美韩电影免费看| 一边摸一边桶一边脱免费视频| 日本免费中文字幕| 91亚洲国产成人久久精品网站| 精品国产日韩亚洲一区在线| 在线观看永久免费视频网站| 粉色视频免费入口| 国产精品亚洲一区二区三区在线 | 亚洲AV成人一区二区三区在线看| 免费无遮挡无码视频在线观看| 99久久免费精品视频| 亚洲国产成人资源在线软件| 日本a级片免费看| 免费无码婬片aaa直播表情| 亚洲成av人影院| 大地资源在线观看免费高清| 日本一区二区三区免费高清在线| 人妻视频一区二区三区免费| 国产亚洲视频在线观看网址| 亚洲国产成人久久综合一区77| 亚洲AV无码资源在线观看| 国产AⅤ无码专区亚洲AV| 国产成人免费视频| 99亚洲男女激情在线观看| 人人狠狠综合久久亚洲婷婷| 免费无码黄十八禁网站在线观看| 亚洲精品在线电影| 国产美女精品久久久久久久免费|