Back: DBI.ColumnInfo-printing Up: DBI package Forward: DBI.Connection class-connecting   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

3.2 DBI.Connection

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework
I represent a connection to a database.

3.2.1 DBI.Connection class: connecting  (class)
3.2.2 DBI.Connection class: initialization  (class)
3.2.3 DBI.Connection: accessing  (instance)
3.2.4 DBI.Connection: connecting  (instance)
3.2.5 DBI.Connection: querying  (instance)


3.2.1 DBI.Connection class: connecting

connect: aDSN user: aUserName password: aPassword
Connect to the database server identified by aDSN using the given username and password. The DSN is in the format dbi:DriverName:dbname=database_name;host=hostname;port=port Where dbi is constant, DriverName is the name of the driver, and everything else is parameters in the form name1=value1;name2=value2;...

Individual drivers may parse the parameters differently, though the existing ones all support parameters dbname, host and port.

paramConnect: params user: aUserName password: aPassword
Connect to the database server using the parameters in params (a Dictionary) and the given username and password (abstract).


3.2.2 DBI.Connection class: initialization

updateDriverList
Private - Look for new subclasses of Connection.


3.2.3 DBI.Connection: accessing

>> aString
Returns a Table object corresponding to the given table.

database
Returns the database name for this connection. This corresponds to the catalog in SQL standard parlance (abstract).

fieldConverter
Returns a FieldConverter that can be used to insert Smalltalk objects into queries.

tableAt: aString
Returns a Table object corresponding to the given table.

tableAt: aString ifAbsent: aBlock
Returns a Table object corresponding to the given table.


3.2.4 DBI.Connection: connecting

close
Close the connection now; should happen on GC too (abstract).


3.2.5 DBI.Connection: querying

do: aSQLQuery
Executes a SQL statement (usually one that doesn't return a result set). Return value is a ResultSet, to which you can send #rowsAffected (abstract).

prepare: aSQLQuery
Creates a statement object, that can be executed (with parameters, if applicable) repeatedly (abstract).

primTableAt: aString ifAbsent: aBlock
Returns a Table object corresponding to the given table. Should be overridden by subclasses.

select: aSQLQuery
Prepares and executes a SQL statement. Returns the result set or throws an exception on failure (abstract).



Back: DBI.Connection-connecting Up: DBI.Connection Forward: DBI.ConnectionInfo   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on July, 23 2009 using texi2html