I am trying to connect to Microsoft sQL Server 2012 database in ruby using the sequel gem.
This is what I have
require "sequel:
require "activerecord-jdbcmssql-adapter"
@db = Sequel.connect("jdbc:sqlserver://<host>;database=<dbname>;user='<userid>';password='pwd'")
When I run this I get the error:
com.microsoft.sqlserver.jdbc.SQLServerDriver not loaded.
How do I load the driver?
Thanks!
You need to require the driver jar file manually before calling Sequel.connect
: require 'path/to/sqljdbc4.jar'
. This is true for all Sequel jdbc subadapters where there isn't a corresponding jdbc-*
gem wrapping the jar.