The last Hack seems to do the trick, BUT DataMapper seems to find the "@" in it's internal DM-URI and is assuming the credentials are already specified somewhere else. So it will ignore the :username and :password parameters seen in the following example:
DataMapper.setup(:default, {:adapter => "oracle", :database => "@MY_SID", :username => "SCOTT", :password => "TIGER"})
# No Username and password arriving in do_jdbc Connection
DataMapper.setup(:default, {:adapter => "oracle", :database => "SCOTT/TIGER@MY_SID"})
# Works! But I hate it :-)
For completeness reasons the jdbc URI with :host parameter:
DataMapper.setup(:default, {:adapter => "oracle", :database => "MY_SID", :host => "localhost", :username => "SCOTT", :password => "TIGER"})
# => JdbcURI: "jdbc:oracle:thin:@//localhost/MY_SID" (looks a bit strange but works)
OJDBC needs URIs in form of:
The Problem is the
@
character in the URIs which is required in the ODJBC URIs. It is present in the URI if you specify a Host.Examples (JDBC-URI visible by accessing the do_jdbc Connection directly):
The last Hack seems to do the trick, BUT DataMapper seems to find the "@" in it's internal DM-URI and is assuming the credentials are already specified somewhere else. So it will ignore the :username and :password parameters seen in the following example:
For completeness reasons the jdbc URI with :host parameter: