ruby连接Oracle
ruby的速度,ruby的灵巧,ruby的简洁,给许多开发人员一个惊喜,rails功不可没,但是ruby本身的优秀也是名不虚传。别的不说了,以下是搜罗出来的ruby与数据库交互小样。格式与Java也差不多,SQL语句嘛,本身就是挺罗嗦的事。不知道ruby什么时候也能整个orm出来,呵呵。#create require 'dbi' dbh = DBI.connect('DBI:OCI8:ORCL', 'hr', 'hr') dbh.do("CREATE TABLE states ( id CHAR(2) PRIMARY KEY, name VARCHAR2(15) NOT NULL, capital VARCHAR2(25) NOT NULL)") dbh.disconnect#insertrequire 'db
Rolling with Rails 2.0
Let’s get started!Recognizing the EnvironmentThis tutorial is geared towards those who already have some knowledge of Rails 1.2. Please refer to the many great Rails tutorials around 1.2 available in the Internet world-wide.The first think you have to do is update your gems: sudo gem install rails --include-dependencies You may probably need to update RubyGems as well: sudo gem update --system First things first. Let’s create a new Rails application:[@more@]rails blogThis will create our u