Hi Dheeraj,

Check the entry in your tnsnames.ora file. It should be something like this
:

*SOMENAME* =
(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = someIP)(PORT = somePORT))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = someDBName)
    )
  )


Now, just enter the *SOMENAME *as in your tnsname.ora file in your
connection string & try:

require 'oci8'
OCI8.new("UserName","Password","*SOMENAME*").exec(....some query...)

Let me know if you face any issues.

Srinivas.

On Wed, Jul 22, 2009 at 3:15 PM, Dheeraj Gambhir <
checktestingthi...@gmail.com> wrote:

> Any help/solution?
>
>
> On Wed, Jul 22, 2009 at 1:18 PM, Dheeraj Gambhir <
> checktestingthi...@gmail.com> wrote:
>
>> Hi Tony,
>>
>> I tried one again that u mentioned here but i am still getting :
>> C:\testwatir>ruby testcon.rb
>> c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:52:in `init': OCI Library
>> Initialization
>> Error (OCIError)
>>         from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:52
>>         from
>> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
>> m_original_require'
>>         from
>> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
>> quire'
>>         from testcon.rb:1
>>
>> Refer to attached screen shot having code and error back to back.
>>
>>
>> Thanks
>> D G
>>
>>
>> On Wed, Jul 22, 2009 at 1:00 PM, Tony <ynot...@gmail.com> wrote:
>>
>>>
>>> Hi Dheeraj,
>>>
>>> Had never connected to oracle db.
>>> Did the below and was able to connect to the db.
>>> 1. Downloaded ruby-oci from
>>> http://rubyforge.org/frs/download.php/56929/ruby-oci8-1.0.6-x86-mswin32-60.gem
>>> .
>>> This downloads as tar file.
>>> 2. Renamed the file from ruby-oci8-1.0.6-x86-mswin32-60.gem.tar to
>>> ruby-oci8-1.0.6-x86-mswin32-60.gem
>>> 3. gem install ruby-oci8-1.0.6-x86-mswin32-60.gem
>>> 4. Downloaded Oracle instant Basic client (45mb) from
>>>
>>> http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html
>>> 5. Extract it to C:\Oracle\instantclient_11_1
>>> 6. Added "C:\Oracle\instantclient_11_1" to the path variable.
>>>
>>> dbtest.rb
>>> require 'oci8'
>>> OCI8.new('<username>', '<password>', '<hostname>:<port>/<SID>').exec
>>> ('select * from temp_cancel_subs') do |r|
>>>  puts r.join(',')
>>> end
>>>
>>> This worked for me. I had to connect to oracle 10g
>>>
>>> Thanks,
>>> Tony
>>>
>>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to