Skip to content

Commit

Permalink
Merge pull request jruby#169 from moger777/fix_jndi_db2
Browse files Browse the repository at this point in the history
return nil if using jndi and schema/user is not set
  • Loading branch information
nicksieger committed Feb 10, 2012
2 parents 361ed15 + 738bb38 commit e02190c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/arjdbc/db2/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,14 @@ def db2_schema
# AS400 implementation takes schema from library name (last part of url)
schema = @config[:url].split('/').last.strip
(schema[-1..-1] == ";") ? schema.chop : schema
else
elsif @config[:username].present?
# LUW implementation uses schema name of username by default
@config[:username] or ENV['USER']
@config[:username]
elsif @config[:jndi].present?
# let jndi worry about schema
nil
else
ENV['USER']
end
else
@config[:schema]
Expand Down

0 comments on commit e02190c

Please sign in to comment.