'Enterprise Lab'

Hoaxes, hoaxes, hoaxes

Today morning the complete staff at our campus received an email warning of a virus. The mail tells you to forward the information to all your colleagues and relatives. Please, please, please, to all who receive such messages: Check the message first if its a hoax before forwarding it to thousands of people. A good link for hoaxes is the hoax index from TU Berlin.

JRuby applications in glassfish – Databases

As I promised earlier, I will now write how I added database support to a JRuby application running under glassfish v2.
The first step you’ll have to do is installing another plugin. The plugin is called “ActiveRecord-JDBC”. You can add this plugin to your rails project by adding “http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/plugins/” to your plugin repositories. If you’re using gem for plugin management, just execute “gem install activerecord-jdbc”.

The second step you’ll have to do is including the Java libraries in your environment. Just edit configure/environment.rb and add “require ‘jdbc_adapter’” to it.

You’re almost done. The last step (and the important one) is to add the new database connectivity to your databases.yml. There you’ll have to edit the “production” section although  you’re developing. Add the following to your configuration:

     production:
      host: localhost
      adapter: jdbc
      driver: com.mysql.jdbc.Driver
      url: jdbc:mysql://localhost/<yourapp>_development
      username: ...
      password: ...

Just recreate your war file and put it in your autodeploy folder. Your JRuby application should now be able to access the MySQL Database.

My first entry

Hello together

Since November, 1. 2007 I got a new job at HSLU T&A. I’m working for the Enterprise Lab team to give technical support to users and maintain the Lab. Also visit my personal web log.
I mostly will write about my experiences with the Enterprise Lab but also about my position as “SUN Campus Ambassador” at SUN Microsystems. Hope to see you soon back here again!

« Previous Page