<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Ruby/DBI數(shù)據(jù)庫(kù)訪問(wèn)接口

          聯(lián)合創(chuàng)作 · 2023-09-30 18:22

          Ruby/DBI 是一個(gè)跟 Perl/DBI 類似的統(tǒng)一數(shù)據(jù)庫(kù)訪問(wèn)接口,支持各種流行的數(shù)據(jù)庫(kù)。

          下面是一段使用了 Ruby/DBI 的代碼:

          #!/usr/bin/ruby -w
          # simple.rb - simple MySQL script using Ruby DBI module

          require "dbi"

          begin
          # connect to the MySQL server
          dbh = DBI.connect("DBI:Mysql:test:localhost", "testuser", "testpass")
          # get server version string and display it
          row = dbh.select_one("SELECT VERSION()")
          puts "Server version: " + row[0]
          rescue DBI::DatabaseError => e
          puts "An error occurred"
          puts "Error code: #{e.err}"
          puts "Error message: #{e.errstr}"
          ensure
          # disconnect from server
          dbh.disconnect if dbh
          end
          瀏覽 16
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  黄频AV | 日韩网站中文字幕 | 欧美日皮视频 | 91成人区人妻 | 亚洲一区欧美国产日韩 云播 |