On Dec 15, 7:07 am, Wei <[email protected]> wrote: > That anonymous class is not about "arg", but is referring the cps, > which is created on jdbc.rb line 299, > basically when it runs to > cps.setDate(i.arg) > exception is thrown. > The funny part is, the switch/case statement will recognize arg as a > Date type, but next line when Jruby tries > to resolve cps.setDate, it fails to recognize arg as a Date. > > Here are the modified jdbc.rb to show some debug info > > def set_ps_arg(cps, arg, i) > puts "Debug arg class is #{arg.class}, arg value is #{arg}" > case arg > .... > when Date, Java::JavaSql::Date > begin > cps.setDate(i, arg) > rescue Exception=>e > puts e.message > puts e.backtrace > end > ..... > else > cps.setObject(i, arg) > end > end > And here are the output: > > Debug arg class is Date, arg value is -2010-10-12 > no setDate with arguments matching [class org.jruby.RubyFixnum, class > org.jruby.RubyObject] on object #<#<Class:01x41692a49>:0x705789f3>
This is probably a JRuby java integration issue. There may be a direct way to fix it by adding some Java integration goo (ask the JRuby guys). You could also attempt to fix it in Sequel by recognizing ruby Date instances and transforming them into Java::JavaSql::Date instances before calling setDate. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
