What are the Rails's ActiveRecord database gems on JRuby

只谈情不闲聊 提交于 2019-12-25 02:57:54

问题


When running rails on JRUBY, database adapters have two different gems.

  1. Sql Server: sqlserver gem Vs activerecord-sqlserver-adapter gem
  2. Mysql: jdbcmysql gem vs activerecord-jdbcmysql-adapter gem
  3. Sqlite3: jdbcsqlite3 gem Vs activerecord-jdbcsqlite3-adapter gem
  4. Postgresql: jdbcpostgresql gem Vs activerecord-jdbcpostgresql-adapter gem
  5. jdbc: jdbc gem vs activerecord-jdbc-adapter gem

So question is, What is the difference between jdbcpostgresql and its long form activerecord-jdbcpostgresql-adapter gem?


回答1:


jdbcpostgresql = Java postgresql database

activerecord-jdbcpostgresql-adapter = a postgresql database adapter for Rails ActiveRecord to allow it to be used with JRuby.

JDBC (Java Database Connectivity)

ActiveRecord-JDBC-Adapter (AR-JDBC) is a database adapter for Rails' ActiveRecord component that can be used with JRuby. It allows use of virtually any JDBC-compliant database with your JRuby on Rails application.




回答2:


i don't know the difference but i use the following in rails 3+ apps with jruby and postgres for the Gemfile

gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby-openssl'

see also the README file - https://github.com/jruby/activerecord-jdbc-adapter



来源:https://stackoverflow.com/questions/15973929/what-are-the-railss-activerecord-database-gems-on-jruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!