快速业务通道

使用XForms 和 Ruby on Rails开发小型门诊管理系统,第1部分 - 编程入门网

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-14
ascripts create public/stylesheets create script/performance create script/process create test/fixtures create test/functional create test/integration create test/mocks/development create test/mocks/test create test/unit create vendor create vendor/plugins create tmp/sessions create tmp/sockets create tmp/cache create tmp/pids create Rakefile create README create app/controllers/application.rb create app/helpers/application_helper.rb create test/test_helper.rb create config/database.yml create config/routes.rb create public/.htaccess create config/boot.rb create config/environment.rb create config/environments/production.rb create config/environments/development.rb create config/environments/test.rb create script/about create script/breakpointer create script/console create script/destroy create script/generate create script/performance/benchmarker create script/performance/profiler create script/process/reaper create script/process/spawner create script/process/inspector create script/runner create script/server create script/plugin create public/dispatch.rb create public/dispatch.cgi create public/dispatch.fcgi create public/404.html create public/500.html create public/index.html create public/favicon.ico create public/robots.txt create public/images/rails.png create public/javascripts/prototype.js create public/javascripts/effects.js create public/javascripts/dragdrop.js create public/javascripts/controls.js create public/javascripts/application.js create doc/README_FOR_APP create log/server.log create log/production.log create log/development.log create log/test.log

使用XForms 和 Ruby on Rails开发小型门诊管理系统,第1部分(7)

时间:2011-11-29 ibm Michael Galpin

这样就完成了 Web 应用程序的框架。还需要编辑 config/database.yml 以便连接到 DB2,如清单 7 所示。

清单 7. 编辑 config/database.yml

# IBM DB2 

Database configuration file
# Install the IBM DB2 driver and get assistance from:
# http://www.alphaworks.ibm.com/tech/db2onrails
development:
adapter: ibm_db
database: health
username: michael
password: your_password_here
schema: xmlmd
# == remote TCP/IP connection (required when no local database catalog entry available)
# host: bigserver // fully qualified hostname or IP address
# port: 50000 // data server TCP/IP port number
# Warning: The database defined as ''test'' will be erased and
# re-generated from your development database when you run ''rake''.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: xmlmd_test
username: root
password:
host: localhost
production:
adapter: mysql
database: xmlmd_production
username: root
password:
host: localhost

请注意该例中只修改了开发设置,而没有改变测试和产品设置。此外把 adapter 设为 ibm_db。这就是刚刚安装的驱动程序。Rails 不知道这个驱动程序,因为它不是 Rails 默认安装的驱动程序。所幸的是很容易修改。只需要编辑一个文件。找到 Ruby 安装目录打开文件 /lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record.rb。找到 RAILS_CONNECTION_ADAPTERS 这一行,

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号