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

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

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

    posts - 33,  comments - 17,  trackbacks - 0
     1MySQL:    
     2    String Driver="com.mysql.jdbc.Driver";    //驅動程序
     3    String URL="jdbc:mysql://localhost:3306/db_name";    //連接的URL,db_name為數據庫名    
     4    String Username="username";    //用戶名
     5    String Password="password";    //密碼
     6    Class.forName(Driver).new Instance();
     7    Connection con=DriverManager.getConnection(URL,Username,Password);
     8Microsoft SQL Server 2.0驅動(3個jar的那個):
     9    String Driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";    //連接SQL數據庫的方法
    10    String URL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name";    //db_name為數據庫名
    11    String Username="username";    //用戶名
    12    String Password="password";    //密碼
    13    Class.forName(Driver).new Instance();    //加載數據可驅動
    14    Connection con=DriverManager.getConnection(URL,UserName,Password);    //
    15Microsoft SQL Server 3.0驅動(1個jar的那個): // 老紫竹完善
    16    String Driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";    //連接SQL數據庫的方法
    17    String URL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name";    //db_name為數據庫名
    18    String Username="username";    //用戶名
    19    String Password="password";    //密碼
    20    Class.forName(Driver).new Instance();    //加載數據可驅動
    21    Connection con=DriverManager.getConnection(URL,UserName,Password);    //
    22Sysbase:
    23    String Driver="com.sybase.jdbc.SybDriver";    //驅動程序
    24    String URL="jdbc:Sysbase://localhost:5007/db_name";    //db_name為數據可名
    25    String Username="username";    //用戶名
    26    String Password="password";    //密碼
    27    Class.forName(Driver).newInstance();    
    28    Connection con=DriverManager.getConnection(URL,Username,Password);
    29Oracle(用thin模式):
    30    String Driver="oracle.jdbc.driver.OracleDriver";    //連接數據庫的方法
    31    String URL="jdbc:oracle:thin:@loaclhost:1521:orcl";    //orcl為數據庫的SID
    32    String Username="username";    //用戶名
    33    String Password="password";    //密碼
    34    Class.forName(Driver).newInstance();    //加載數據庫驅動
    35    Connection con=DriverManager.getConnection(URL,Username,Password);    
    36PostgreSQL:
    37    String Driver="org.postgresql.Driver";    //連接數據庫的方法
    38    String URL="jdbc:postgresql://localhost/db_name";    //db_name為數據可名
    39    String Username="username";    //用戶名
    40    String Password="password";    //密碼
    41    Class.forName(Driver).newInstance();    
    42    Connection con=DriverManager.getConnection(URL,Username,Password);
    43DB2:
    44    String Driver="com.ibm.db2.jdbc.app.DB2.Driver";    //連接具有DB2客戶端的Provider實例
    45    //String Driver="com.ibm.db2.jdbc.net.DB2.Driver";    //連接不具有DB2客戶端的Provider實例
    46    String URL="jdbc:db2://localhost:5000/db_name";    //db_name為數據可名
    47    String Username="username";    //用戶名
    48    String Password="password";    //密碼
    49    Class.forName(Driver).newInstance();    
    50    Connection con=DriverManager.getConnection(URL,Username,Password);
    51Informix:
    52    String Driver="com.informix.jdbc.IfxDriver";    
    53    String URL="jdbc:Informix-sqli://localhost:1533/db_name:INFORMIXSER=myserver";    //db_name為數據可名
    54    String Username="username";    //用戶名
    55    String Password="password";    //密碼
    56    Class.forName(Driver).newInstance();    
    57    Connection con=DriverManager.getConnection(URL,Username,Password);
    58JDBC-ODBC:
    59    String Driver="sun.jdbc.odbc.JdbcOdbcDriver";
    60    String URL="jdbc:odbc:dbsource";    //dbsource為數據源名
    61    String Username="username";    //用戶名
    62    String Password="password";    //密碼
    63    Class.forName(Driver).newInstance();    
    64    Connection con=DriverManager.getConnection(URL,Username,Password);
    65
    posted on 2008-07-24 08:27 scea2009 閱讀(215) 評論(0)  編輯  收藏 所屬分類: 網摘

    <2008年7月>
    293012345
    6789101112
    13141516171819
    20212223242526
    272829303112
    3456789

    常用鏈接

    留言簿(1)

    隨筆分類

    隨筆檔案

    PL/SQL存儲過程與函數

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 日韩免费码中文在线观看| 成人男女网18免费视频| 亚洲人色大成年网站在线观看| 美女羞羞免费视频网站| 免费的涩涩视频在线播放| 亚洲天堂男人影院| 最近免费中文字幕大全视频 | 一级一片免费视频播放| 在线永久免费观看黄网站| 鲁死你资源站亚洲av| 国产一级a毛一级a看免费人娇| 亚洲高清偷拍一区二区三区| 亚洲国产成人AV网站| ww在线观视频免费观看| 亚洲伊人久久大香线焦| 成人免费淫片在线费观看 | 亚洲免费一区二区| 亚洲女人18毛片水真多| 免费人成动漫在线播放r18 | 亚洲国产精品午夜电影| 成人免费网站在线观看| 无码人妻一区二区三区免费视频 | 亚洲高清专区日韩精品| 2015日韩永久免费视频播放 | 日韩免费在线观看视频| 日本二区免费一片黄2019| 在线观看亚洲免费视频| 中文字幕日韩亚洲| 亚洲精品成a人在线观看☆| 美女视频黄a视频全免费网站色窝| 色播在线永久免费视频| 成年大片免费视频播放一级| 亚洲成av人在线视| 成年在线网站免费观看无广告| 免费看一级毛片在线观看精品视频| 亚洲三区在线观看无套内射| 国产高清免费视频| jizz18免费视频| 亚洲日韩中文在线精品第一| 久久久久亚洲精品无码网址色欲 | 综合在线免费视频|