简体   繁体   English

Ruby on Rails可以连接到Mac OS X或Windows上的Oracle / RDB吗?

[英]Can Ruby on Rails connect to Oracle/RDB on Mac OS X or Windows?

I have an older database Oracle RDB. 我有一个较旧的数据库Oracle RDB。 I used ODBC on Windows with .net, but I'm not sure how to proceed on RoR on a Mac OS X server. 我在Windows和.net上使用了ODBC,但是我不确定如何在Mac OS X服务器上的RoR上进行操作。 I don't know how I do it on Windows either with RoR. 我也不知道如何在Windows上使用RoR来执行此操作。

I was hoping for general direction. 我希望有大致的方向。

EDIT: I searched for activerecord and rdb but have nto found it yet. 编辑:我搜索了activerecord和rdb,但尚未找到它。 I saw references to rdb$database and so on in code for firebird but that's it. 我在Firebird的代码中看到了对rdb $ database等的引用,仅此而已。

You need to use the Oracle Rdb specific JDBC driver. 您需要使用特定于Oracle Rdb的JDBC驱动程序。 Go to http://www.oracle.com/technetwork/database/rdb/index-090638.html 转到http://www.oracle.com/technetwork/database/rdb/index-090638.html

How old? 几岁? because there are some resources for Rails and Oracle, like this 因为有一些Rails和Oracle的资源,像这样

http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html

or maybe you could try with JRuby and JDBC, it's super easy, you have to copy the oracle jdbc jar file in the jruby/lib folder, and then in the rails project setup your database (config/database.yml) like this 或者也许您可以尝试使用JRuby和JDBC,这非常简单,您必须将oracle jdbc jar文件复制到jruby / lib文件夹中,然后在rails项目中像这样设置数据库(config / database.yml)

production:
  adapter: jdbc
  driver: oracle.jdbc.OracleDriver
  url: jdbc:oracle:thin:@you_server_address:1521:instanceName
  username: user
  password: pass

Oracle RDB与Oracle RDBMS不同

This question shows how to configure RoR with Oracle on linux and mac: 此问题说明如何在Linux和Mac上使用Oracle配置RoR:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM