0

I have unlocked the hr user for oracle and I have created some tables there. I am trying to access these tables through a web service that I wrote in ruby but i keep getting this error: the tns could not resolve the connect identifier specified

here is the code I use

    get '/all_members/' do
conn=OCI8.new('hr','hr', '//localhost/XE')
recordsArray = "{\"clientList\":["
clientArray = Array.new
records = conn.exec('select * from Team_Members') do |record|
    client = AndroidtableClients.new(record[0],record[1],record[2],record[3], record[4], record[5])
    clientArray<<client.to_s
end
conn.logoff
recordsArray<<clientArray.join(',')
recordsArray<<"]}"
recordsArray

end

to call the function, I use google's Advanced Rest Client and i use the following URL: http://localhost:4567/all_members/

Can someone help me?

meow
  • 59
  • 10
  • Possible duplicate of [on using oracle database link theres an error "ORA-12154 TNS Could not resolve the connect identifier specified"](http://stackoverflow.com/questions/10417010/on-using-oracle-database-link-theres-an-error-ora-12154-tns-could-not-resolve-t) – Mike Szyndel Jan 12 '16 at 13:41
  • i have consulted that solution but it did not work – meow Jan 12 '16 at 13:46
  • Oracle documentation for that bug clearly states that connection credentials are incorrect. – Mike Szyndel Jan 12 '16 at 14:05
  • I can connect on sql using connect hr/hr@localhost – meow Jan 12 '16 at 14:08

0 Answers0