backport type_cast_config_to_xxx adapter helpers from AR-4.0
backport type_cast_config_to_xxx adapter helpers from AR-4.0

kares/activerecord-jdbc-adapter,kares/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,keeguon/activerecord-jdbc-adapter,keeguon/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,jruby/activerecord-jdbc-adapter,bruceadams/activerecord-jdbc-adapter,kares/activerecord-jdbc-adapter,keeguon/activerecord-jdbc-adapter,bruceadams/activerecord-jdbc-adapter,bruceadams/activerecord-jdbc-adapter