<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>smoothy</author_name>
  <author_url>https://blog.hatena.ne.jp/smoothy/</author_url>
  <blog_title>smoothy</blog_title>
  <blog_url>https://smoothy.hatenadiary.org/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyをはじめたので、とりあえずデータベースに接続してみます。 データベースはMySQLを利用します。各ライブラリはインストールされているものとします・・・ Ruby/DBI require 'dbi'begin # データベース接続。DBI::DatabaseHandleオブジェクトを作成 db = DBI::connect(&quot;dbi:Mysql:database:hostname&quot;, &quot;username&quot;, &quot;password&quot;) sql = &quot;select * from users&quot; rs = db.execute sql # eachで1件ずつオブジェクトをフェッチできる rs.ea…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsmoothy.hatenadiary.org%2Fentry%2F20080206%2F1202302007&quot; title=&quot;データベースに接続してみた - smoothy&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-02-06 21:46:47</published>
  <title>データベースに接続してみた</title>
  <type>rich</type>
  <url>https://smoothy.hatenadiary.org/entry/20080206/1202302007</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
