On Tue, May 25, 2010 at 10:54 AM, pepe <[email protected]> wrote:
> On May 25, 11:46 am, Nick Sieger <[email protected]> wrote:
>> Have you tried using JRuby with activerecord-jdbcmssql-adapter? We've
>> heard multiple stories from folks having better luck using JRuby to
>> connect to SQLServer than with the buggy ODBC driver.
>
> The thought has crossed my mind, especially since I already wrote some
> time ago a Java app. that connected to SQL Server 2005 with no problem
> whatsoever and I am guessing JRuby could be using Java "stuff". I
> actually took a look at that code I wrote a while back to check out
> the connection string. The thing is that I have never created a JRuby
> application and I don't know if I want to go through the learning
> curve. I haven't really looked at JRuby at all and this project needs
> to get going pretty fast. Do you have any recommendations about JRuby
> documentation? Any comments about the learning curve?
>
> Thanks!

The experience should be identical to Ruby -- just substitute "jruby"
for "ruby" in your command lines and that's about it, really. Just
head over to jruby.org/downloads, grab a windows installer, and go.

The one difference is to "jruby -S gem activerecord-jdbcmssql-adapter"
to install JRuby's SQLServer support. You'll also want to review one
more step outlined here to run the "jdbc" generator:

http://blog.nicksieger.com/articles/2009/10/12/fresh-0-9-2-activerecord-jdbc-adapter-release

Once you've run that generator, use "mssql" for the adapter name in
database.yml.

Cheers,
/Nick

>
>>
>> /Nick
>>
>>
>>
>> On Tue, May 25, 2010 at 9:27 AM, pepe <[email protected]> wrote:
>> > On May 24, 8:06 pm, ct9a <[email protected]> wrote:
>> >> guys,
>>
>> >> It's interesting. Did the post below solve the problem?
>>
>> > Not for me. I am still working on getting the connection working,
>> > although I have not spent too much time on it. I am using SQL Server
>> > 2005, though, and I know pretty much nothing about SQL Server so it's
>> > being a little bit of a learning curve to set this up.
>>
>> > So far I have installed DBI and activerecord-sqlserver-adapter
>> > (2.3.5). After I did that I tried to use mode ADO and got this:
>>
>> > NotImplementedError: Please use version 2.3.1 of the adapter for ADO
>> > connections. Future versions may support ADO.NET.
>>
>> > So I installed 2.3.1 instead and got this when starting the console
>> > (but it let me in):
>>
>> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
>> > connection_adapters/abstract/connection_specification.rb:76:in
>> > `establish_connection':RuntimeError: Please install the sqlserver
>> > adapter: `gem install activerecord-sqlserver-adapter` (no such file to
>> > load -- deprecated)
>>
>> > and this when trying to instantiate a new record for a table:
>>
>> > ActiveRecord::ConnectionNotEstablished:
>> > ActiveRecord::ConnectionNotEstablished from c:/ruby/lib/ruby/gems/1.8/
>> > gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
>> > connection_pool.rb:326:in `retrieve_connection'
>>
>> > Seeing this amount of "success" I switched back to 2.3.5 and changed
>> > the mode to ODBC, but the DSN parameter gave me trouble. Now I think
>> > the DSN is OK (not sure, though):
>>
>> > dsn:      Driver={SQL Server};Server=<server_name>
>>
>> > where <server_name> is the server name showing in the Connection
>> > Properties window off the DB Management application (Microsoft SQL
>> > Server Management Studio Express).
>>
>> > I think the DSN is OK because of the error I am getting now, which
>> > could indicate that I have passed the DSN problem but there is
>> > something else going on. Now starting the console gives no errors but
>> > I can't get to the tables (testing from the console with a 'Table.new'
>> > command):
>>
>> > ODBC::Error: S1090 (0) [Microsoft][ODBC Driver Manager] Invalid string
>> > or buffer length
>>
>> > I have checked on error S1090 and this is what I found:
>>
>> > SQLExecute
>> >    S1090
>> >        Invalid string or buffer length. One of the following
>> > situations:
>>
>> >            * Parameter pointer is null and length does not equal
>> > SQL_NULL_DATA.
>> >            * Parameter is not null and length is equal to
>> > SQL_NULL_DATA.
>> >            * Parameter is not null, length is negative, length is not
>> > equal to SQL_NULL_DATA, and length is not equal to SQL_NTS.
>>
>> > I seems to me like some type of "configuration" error. If anybody has
>> > an idea of what could be going on I would appreciate any help and if I
>> > get a connection working I'll make sure I post here the steps it took
>> > me to make it work.
>>
>> >> On May 19, 11:18 am, jason white <[email protected]> wrote:
>>
>> >> > this may 
>> >> > helphttp://www.codecapers.com/post/A-Ruby-on-Rails-Tutorial-for-NET-Devel...
>>
>> >> > Jason
>>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups 
>> >> "Ruby on Rails: 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 
>> >> athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Ruby on Rails: 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 
>> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: 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 
>> athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: 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/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: 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/rubyonrails-talk?hl=en.

Reply via email to