Class: DBI::DBD::MSSQL::Driver
- Inherits:
-
BaseAdonetDriver
- Object
- BaseAdonetDriver
- DBI::DBD::MSSQL::Driver
- Defined in:
- lib/dbd/mssql/driver.rb
Constant Summary collapse
- PROVIDER_KEY =
:mssql
Instance Method Summary collapse
-
#connect(db_args, user, auth, attr) ⇒ Object
Connect to the database.
- #create_database(connection, attr) ⇒ Object
-
#initialize ⇒ Driver
constructor
A new instance of Driver.
Constructor Details
#initialize ⇒ Driver
Returns a new instance of Driver.
9 10 11 |
# File 'lib/dbd/mssql/driver.rb', line 9 def initialize super(DBI::IRONRUBY::USES_DBD_VERSION, PROVIDER_KEY) end |
Instance Method Details
#connect(db_args, user, auth, attr) ⇒ Object
Connect to the database. DBD Required.
14 15 16 17 18 19 20 21 22 |
# File 'lib/dbd/mssql/driver.rb', line 14 def connect(db_args, user, auth, attr) connection = factory.create_connection # db_args = "#{db_args}; MultipleActiveResultSets=true;" unless db_args =~ /MultipleActiveResultSets/i connection.connection_string = db_args connection.open return create_database(connection, attr); rescue RuntimeError, System::Data::SqlClient::SqlException => err raise DBI::DatabaseError.new(err.) end |