cubrid-ruby¶ ↑
Description¶ ↑
This is a Ruby Driver and ActiveRecord Adapter for CUBRID Database. The latest version of CUBRID Ruby driver can be found at:
ftp.cubrid.org/CUBRID_Drivers/Ruby_Driver/
Installation¶ ↑
1. cd ext/ 2. ruby extconf.rb 3. make install
Gem Installation¶ ↑
Windows: > gem install cubrid Linux: $ sudo -E gem install cubrid
Features/Dependencies¶ ↑
-
Cross-platform
-
Compatible with CUBRID 11.0
-
Compatible with Ruby 1.9 or higher
Synopsis¶ ↑
Use Case:
require 'cubrid'
#1: @con = Cubrid.connect('dbname')
#2: @con = Cubrid.connect('dbname', 'host', 'port', 'username', 'password')
@con = Cubrid.connect('demodb', 'localhost', '30000', 'public', '')
puts @con.server_version
if @con
sql = "SELECT * FROM event"
stmt = @con.prepare(sql)
stmt.execute
while row = stmt.fetch
end else puts "Connection could not be established" end