简体   繁体   中英

ruby connect to oracle using kerberos

Since Oracle has built in support for kerberos and sqlplus can connect to database using kerberos using oci8 can i do something similar in ruby like this ?

require 'oci8'
oci = OCI8.new('SomeUser','SomePass','hostname.servicename')
oci.exec('select * from table') do |record|
  puts record.join(',')
end

can i have a blank username and password ? and will the connection be sucessful ? am i on the right path ?

I guess, Ruby/RoR is compiled against OCI, since Oracle Call Interface and Net Services Support Kerberos authentication this is possible. Although I cannot tell whether there might be some limitation in Ruby's interface.

First of all, you need to get it working with SQL*Plus , after that try your application. Begin with Configuring Kerberos Authentication .

If Ruby OCI8 is implemented correctly, this should do it:

OCI8.new(nil, nil, 'net_service_name')

or

OCI8.new('/@net_service_name')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM