# Remote MSSQL database JDBC URL and driver

**URL:** <https://www.ruby-forum.com/t/remote-mssql-database-jdbc-url-and-driver/182537>\
**Category:** Rails\
**Created:** [January 29, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/remote-mssql-database-jdbc-url-and-driver/182537 "2010-01-29T15:34:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [January 29, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/remote-mssql-database-jdbc-url-and-driver/182537/1 "2010-01-29T15:34:55Z")

</div>

Right now I’m connecting to a remote MSSQL db using sqljdbc4.jar from  
Netbeans, which works fine for Java. However, for Ruby (not Jruby,  
note), what’s best? Would this adapter work:

> **[GitHub - rails-sqlserver/2000-2005-adapter: Old Home For The ActiveRecord...](https://github.com/rails-sqlserver/2000-2005-adapter)**
>
> Old Home For The ActiveRecord SQLServerAdapter. Contribute to rails-sqlserver/2000-2005-adapter development by creating an account on GitHub.

I ask because the MSSQL db expects a JDBC connection, I think, wheras  
the  
Ruby adapter won’t be JDBC (does the db even know?). My connection info  
is like so:

Database URL: jdbc:sqlserver://foo.com:1433;databaseName=bar  
Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver  
Schema: baz  
User: foobar

at least, that’s how it appears in the IDE. Microsoft doesn’t have Ruby  
driver as they do for JDBC [Microsoft JDBC Driver for SQL Server - JDBC Driver for SQL Server | Microsoft Learn](http://support.microsoft.com/kb/313100) ?

Can this info basically be copied over to the database.yml file?

I notice projects like:

[http://kenai.com/projects/jruby/pages/ActiveRecord-JDBC](http://kenai.com/projects/jruby/pages/ActiveRecord-JDBC)

however, I’d prefer to stick with “regular” Ruby over JRuby. I don’t  
have to use JRuby for the connection, do I?

thanks,

Thufir
