@@ -34,7 +34,9 @@ def native_database_types
3434 end
3535
3636 # @deprecated no longer used - only kept for compatibility
37- def set_native_database_types ; end
37+ def set_native_database_types
38+ ArJdbc . deprecate "set_native_database_types is no longer used and does nothing override native_database_types instead"
39+ end
3840
3941 def self . jndi_config? ( config )
4042 config [ :jndi ] || config [ :data_source ]
@@ -74,7 +76,8 @@ def setup_jndi_factory
7476
7577 def setup_jdbc_factory
7678 if ! config [ :url ] || ( ! config [ :driver ] && ! config [ :driver_instance ] )
77- raise ::ActiveRecord ::ConnectionNotEstablished , "jdbc adapter requires :driver class and :url"
79+ msg = config [ :url ] ? ":url = #{ config [ :url ] } " : ":driver = #{ config [ :driver ] } "
80+ raise ::ActiveRecord ::ConnectionNotEstablished , "jdbc adapter requires :driver and :url (got #{ msg } )"
7881 end
7982
8083 url = jdbc_url
@@ -93,8 +96,9 @@ def setup_jdbc_factory
9396
9497 def jdbc_url
9598 url = config [ :url ] . to_s
96- if Hash === config [ :options ]
97- options = config [ :options ] . map { |key , val | "#{ key } =#{ val } " } . join ( '&' )
99+ if options = config [ :options ]
100+ ArJdbc . deprecate "use config[:properties] to specify connection URL properties instead of config[:options]"
101+ options = options . map { |key , val | "#{ key } =#{ val } " } . join ( '&' ) if Hash === options
98102 url = url [ '?' ] ? "#{ url } &#{ options } " : "#{ url } ?#{ options } " unless options . empty?
99103 config [ :url ] = url ; config [ :options ] = nil
100104 end
0 commit comments