ruby connect to oracle under linux


 BlinkList   del.icio.us   digg   Furl   linkaGoGo   Newsvine   reddit   Shadows   Simpy   Spurl.net   Tailrank   Yahoo! My Web
Still remember my blog on how to installing RubyOnRails On CentOS?
This is the additional on how to connect your ruby to oracle, to be precise rather than a blog, its a weblink. Because after I follow steps on

http://ruby-oci8.rubyforge.org/en/HowToInstall.html

I can connect my ruby to Oracle, the key is Oracle Instant Client (must install it, I choose the RPM version)
to test ruby connection to Oracle paste this code

ruby -r oci8 -e "OCI8.new('scott', 'tiger','ORCL').exec('select * from emp') do |r| puts r.join(','); end"

replace ORCL with your Oracle TNSName or try this

ruby -r oci8 -e "OCI8.new('scott', 'tiger','//server.company.com:1521/orcl').exec('select * from emp') do |r| puts r.join(','); end"

more detail about Oracle on Ruby
http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html
http://www.oracle.com/technology/pub/articles/saternos-ror-faq.html


Page :  1