ruby-odbc-0.9995
This is an ODBC binding for Ruby. So far it has been tested with
- Ruby 1.[6-8], MySQL 3.22/MyODBC (local), unixODBC 2.1.0
on Linux 2.2-x86
- Ruby 1.6.4, MySQL 3.22/MyODBC (local), libiodbc 2.50
on Linux 2.2-x86
- Ruby 1.[6-8], MySQL 3.22/MyODBC (remote), MS Jet Engine, MSVC++ 6.0
on Windows NT4SP6
- Ruby 1.6.[3-5], MySQL 3.22/MyODBC (remote), MS Jet Engine, cygwin,
on Windows NT4SP6 and 2000
- Ruby 1.8.*, SQLite/ODBC >= 0.67, libiodbc 3.52.4 on Fedora Core 3 x86
Michael Neumann <neumann@s-direktnet.de> and
Will Merrell <wmerrell@catalystcorp.com> reported successful compilation
with Cygwin on Win32.
Requirements:
- Ruby 1.6.[3-8] or Ruby >= 1.7
- unixODBC 2.x or libiodbc 3.52 on UN*X
Installation:
$ ruby extconf.rb [--enable-dlopen|--disable-dlopen]
$ make
# make install
--enable/disble-dlopen turns on/off special initialization
code to make ruby-odbc agnostic to unixODBC/iODBC driver
manager shared library names when GCC is used for compile.
In cases where unixODBC or iODBC is installed in non-standard
locations, use the option --with-odbc-dir=<non-standard-location>
when running extconf.rb
Installation of utf8 version:
$ ruby -Cutf8 extconf.rb [--enable-dlopen|--disable-dlopen]
$ make -C utf8
# make -C utf8 install
Installation MSVC:
C:..>ruby extconf.rb
C:..>nmake
C:..>nmake install
C:..>cd utf8
C:..>ruby extconf.rb
C:..>nmake
C:..>nmake install
Testing:
$ ruby test.rb DSN [uid] [pwd]
or
$ ruby -KU -Cutf8 test.rb DSN [uid] [pwd]
Usage:
Refer to doc/odbc.html
The difference between utf8 and non-utf8 versions are:
- non-utf8 version uses normal SQL.* ANSI functions
- utf8 version uses SQL.*W UNICODE functions and
requires/returns all strings in UTF8 format
Thus, depending on the -K option of ruby one could use
that code snippet:
...
if $KCODE == "UTF8" then
require 'odbc_utf8'
else
require 'odbc'
fi
It is also possible to load both non-utf8 and utf8 version
into ruby:
...
# non-utf8 version
require 'odbc'
# utf8 version
require 'odbc_utf8'
Whichever is loaded first, gets the module name 'ODBC'.
The second loaded module will be named 'ODBC_UTF8' (for
'odbc_utf8') or 'ODBC_NONE' (for 'odbc'). That should
allow to use both versions simultaneously in special
situations.
TODO:
- heavier testing
- improve documentation
Author:
Christian Werner
mailto:chw@ch-werner.de
http://www.ch-werner.de/rubyodbc
=====================================================================================
Description
The DBI package is a vendor independent interface for accessing databases.
It is similar, but not identical to, Perl's DBI module.
Prerequisites
Ruby 1.8.0 or later.
RubyForge Project
General information: http://rubyforge.org/projects/ruby-dbi/
Downloads: http://rubyforge.org/frs/?group_id=234
Installation
Many available DBDs come with this package, but you should only install
the DBDs you really need.
To install everything:
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
To install dbi and some DBDs:
ruby setup.rb config --with=dbi,dbd_pg, ...
ruby setup.rb setup
ruby setup.rb install
Choose the packages to install by specifing them after the option --with.
Synopsis
require 'dbi'
# Connect to a database, old style
dbh = DBI.connect('DBI:Mysql:test', 'testuser', 'testpwd')
# Insert some rows, use placeholders
1.upto(13) do |i|
sql = "insert into simple01 (SongName, SongLength_s) VALUES (?, ?)"
dbh.do(sql, "Song #{i}", "#{i*10}")
end
# Select all rows from simple01
sth = dbh.prepare('select * from simple01')
sth.execute
# Print out each row
while row=sth.fetch do
p row
end
# Close the statement handle when done
sth.finish
# Don't prepare, just do it!
dbh.do('delete from simple01 where internal_id > 10')
# And finally, disconnect
dbh.disconnect
# Same example, but a little more Ruby-ish
DBI.connect('DBI:Mysql:test', 'testuser', 'testpwd') do | dbh |
sql = "insert into simple01 (SongName, SongLength_s) VALUES (?, ?)"
dbh.prepare(sql) do | sth |
1.upto(13) { |i| sth.execute("Song #{i}", "#{i*10}") }
end
dbh.select_all('select * from simple01') do | row |
p row
end
dbh.do('delete from simple01 where internal_id > 10')
end
Available Database Drivers (DBDs)
DBD::ADO
ADO (ActiveX Data Objects)
Requires win32ole, part of the Ruby standard library.
DBD::DB2
DB2
Depends on the ruby-db2 package, available on the RAA.
DBD::Frontbase
Frontbase
Depends on the ruby-frontbase package, available on the RAA.
DBD::InterBase
Interbase
Depends on the interbase package, available on the RAA.
DBD::mSQL
mSQL
Depends on the msql package, available on the RAA.
DBD::MySQL
MySQL
Depends on the mysql-ruby package from http://www.tmtm.org/mysql or
available from the RAA.
DBD::ODBC
ODBC
Depends on the ruby-odbc package (0.5 or later, 0.9.3 or later recommended) at
http://www.ch-werner.de/rubyodbc or available from the RAA. Works together
with unix-odbc.
DBD::Oracle
Oracle
Depends on the oracle package 0.2.11 or later, available on the RAA. This
driver is deprecated in favor of DBD::OCI8.
DBD::OCI8
OCI8 (Oracle)
Depends on the the ruby-oci8 package, available on the RAA and RubyForge.
DBD::Pg
PostgreSQL
Depends on either the postgres or postgres-pr package, both available on
the RAA.
DBD::Proxy
Proxy/Server
Depends on distributed Ruby (DRb), part of the Ruby standard library.
DBD::SQLite
SQLite
Depends on the sqlite package, available on the RAA.
DBD::SQLRelay
SQLRelay
Depends on the sqlrelay package at http://www.firstworks.com/sqlrelay
Additional Documentation
See the directories lib/*/doc or ext/*/doc for DBI and DBD specific information.
The DBI specification is at lib/dbi/doc/DBI_SPEC.
The DBD specification is at lib/dbi/doc/DBD_SPEC.
Articles
Using the Ruby DBI Module
http://www.kitebird.com/articles/ruby-dbi.html
Applications
sqlsh.rb
The SQL command line interpreter sqlsh.rb is available in directory
bin/commandline. It gets installed by default.
License
Copyright (c) 2005-2006 Kirk Haines, Francis Hwang, Patrick May and Daniel
Berger.
Copyright (c) 2001, 2002, 2003, 2004 Michael Neumann <mneumann@ntecs.de>
and others (see the beginning of each file for copyright holder information).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This is the BSD license which is less restrictive than GNU's GPL
(General Public License).
Contributors
Kirk Haines
One of the authors of the rewrite effort (January 2006).
Francis Hwang
One of the authors of the rewrite effort (January 2006).
Patrick May
One of the authors of the rewrite effort (January 2006).
Daniel Berger
One of the authors of the rewrite effort (January 2006).
Michael Neumann
Original author of Ruby/DBI; wrote the DBI and most of the DBDs.
Rainer Perl
Author of Ruby/DBI 0.0.4 from which many good ideas were taken.
Jim Weirich
Original author of DBD::Pg. Wrote additional code (e.g. sql.rb,
testcases). Gave many helpful hints and comments.
Eli Green
Implemented DatabaseHandle#columns for Mysql and Pg.
Masatoshi SEKI
For his version of module BasicQuote in sql.rb.
John Gorman
For his case insensitive load_driver patch and parameter parser.
David Muse
For testing the DBD::SQLRelay and for his initial DBD.
Jim Menard
Extended DBD::Oracle for method columns.
Joseph McDonald
Fixed bug in DBD::Pg (default values in method columns).
Norbert Gawor
Fixed bug in DBD::ODBC (method columns) and proxyserver.
James F. Hranicky
Patch for DBD::Pg (cache PGResult#result in Tuples) which increased
performance by a factor around 100.
Stephen Davies
Added method Statement#fetch_scroll for DBD::Pg.
Dave Thomas
Several enhancements.
Brad Hilton
Column coercing patch for DBD::Mysql.
Sean Chittenden
Originally a co-owner of the project. Submitted several patches
and helped with lots of comments.
MoonWolf
Provided the quote/escape_byte patch for DBD::Pg, DBD::SQLite patch and
Database#columns implementation. Further patches.
Paul DuBois
Fixed typos and formatting. Maintains DBD::Mysql.
Tim Bates
Bug fixes for Mysql and DBI.
Brian Candler
Zero-padding date/time/timestamps fix.
Florian G. Pflug
Discussion and helpful comments/benchmarks about DBD::Pg async_exec vs.
exec.
Oliver M. Bolzer
Patches to support Postgres arrays for DBD::Pg.
Stephen R. Veit
ruby-db2 and DBD::DB2 enhancements.
Dennis Vshivkov
DBD::Pg patches
Cail Borrell from frontbase.com
For the Frontbase DBD and C interface.
分享到:
相关推荐
perl-DBI-1.609-4.el6.x86_64.rpm perl-hivex-1.3.3-4.2.el6.x86_64.rpm polkit-0.96-5.el6_4.x86_64.rpm pyOpenSSL-0.13.1-1.el6.x86_64.rpm PyPAM-0.5.0-12.el6.x86_64.rpm pysendfile-2.0.0-3.el6.x86_64.rpm ...
perl-DBI-1.609-4.el6.x86_64.rpm perl-hivex-1.3.3-4.2.el6.x86_64.rpm polkit-0.96-5.el6_4.x86_64.rpm pyOpenSSL-0.13.1-1.el6.x86_64.rpm PyPAM-0.5.0-12.el6.x86_64.rpm pysendfile-2.0.0-3.el6.x86_64.rpm ...
Linux环境mysql5.5.59安装包系列6:perl-DBD-MySQL-4.014-1.el6.rfx.x86_64.rpm
centos7环境下的mariadb10.4.7 rpm包:boost-program-...perl-DBI-1.627-4.el7.x86_64.rpm;perl-IO-Compress-2.061-2.el7.noarch.rpm;perl-Net-Daemon-0.48-5.el7.noarch.rpm;perl-PlRPC-0.2020-14.el7.noarch.rpm
perl-DBI-1.52-2.el5.i386.rpm
- 数据库连接:通过`DBI->connect()`函数建立到MySQL服务器的连接。 - SQL查询:使用`prepare()`,`execute()`方法执行SQL查询,并通过`fetchrow_array()`,`fetchall_arrayref()`等方法获取结果。 - 错误处理:使用...
DBI is a database access ... The DBI API Specification defines a set of functions, variables and conventions that provide a consistent database interface independent of the actual database being used.
解压DBI-1.13.tar.gz文件 这时会新建一个DBI-1.13的目录。 cd DBI-1.13 生成makefile: perl Makefile.PL 建立模块 make 测试模块 make test 如果测试结果报告“all test ok”,就...
DBD(Database Driver)则是DBI的具体实现,针对不同的数据库系统提供了特定的驱动,DBD-Oracle就是专门为Oracle数据库设计的DBD。 首先,我们来了解一下Perl的DBI。DBI是Perl社区为了简化数据库访问而开发的一个...
perl-DBI-1.52-2.el5.x86_64
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
An implementation of DBI for MySQL for Perl.
DBD-mysql是Database Driver for MySQL的缩写,是Perl DBI(Database Interface)的一部分,DBI是Perl语言中一个通用的数据库接口,允许开发者使用相同的API与多种数据库进行交互。DBD-mysql模块则专为与MySQL数据库...
1. **perl-DBI-1.627-4.el7.x86_64.rpm**:这是Perl数据库接口(DBI)的包,是Perl语言连接各种数据库的标准模块,包括MySQL。DBI提供了统一的API来访问不同的数据库,使得代码可移植。 2. **perl-...
安装宝石时,可以通过`gem install`命令,例如`gem install ruby-oci8-2.1.0.gem`,然后按照提示完成配置。在Windows上,可能还需要设置环境变量`ORACLE_HOME`指向Oracle客户端的安装目录,并将`oci.dll`所在的路径...
《IBM DB2数据库连接Python驱动 ibm_db-3.1.0-new.tar.gz 深度解析》 在IT行业中,数据库系统是数据管理和处理的核心,而IBM DB2作为一款强大的企业级数据库,广泛应用于金融、电信等关键领域。...
在"DBI-1.636.tar.gz"这个压缩包中,包含的是DBI模块的1.636版本源代码。解压后,你可以找到DBI的源文件,用于编译和安装到你的Perl环境中。通常,这样的源码包会包括如下几个部分: 1. `INSTALL`:提供了安装指南...
DBI-1.631是DBI的一个特定版本,该版本包含了对数据库操作的各种增强和改进。下面将详细讨论DBI模块的关键特性和在Perl中的使用方法。 1. **DBI接口**: - **连接数据库**:DBI通过`connect`函数建立与数据库的...
DBD-mysql-4.011.tar.gz 是一个针对Perl编程语言的数据库接口模块,全称为DBD::mysql。这个模块使得Perl程序能够与MySQL数据库进行交互,它提供了连接、查询、结果处理等基本功能,是Perl开发数据库应用的重要工具。...
perl-DBI-1.627-4.el7.x86_64.rpm perl-IO-Compress-2.061-2.el7.noarch.rpm perl-Net-Daemon-0.48-5.el7.noarch.rpm perl-PlRPC-0.2020-14.el7.noarch.rpm 1 yum install boost-program-options-1.53.0-27....