Method: IBRuby::Database#connect

Defined in:
lib/src.rb

#connect(user = nil, password = nil, options = nil) {|connection| ... } ⇒ Object

This method attempts to establish a connection to a database. If successful then a Connection instance is returned. If a block is provided to the method then the connection is closed after the block completes. If a block is specified the connection is provided as a parameter to the block.

Parameters

user

The user name to be used in making the connection. This defaults to nil.

password

The password to be used in making the connection. This defaults to nil.

options

A Hash of connection options. This should be made up of key/setting pairs where the keys are from the list that is defined within the Connection class. The settings are particular to the key, see the documentation for the Connection class for more details.

Exceptions

Exception

Thrown whenever a problem occurs connecting with the database.

Yields:

  • (connection)


104
105
106
# File 'lib/src.rb', line 104

def connect(user=nil, password=nil, options=nil)
   yield(connection)
end