Package | com.ericfeminella.sql.utils |
Class | public class SQLConnectionHelper |
SQLConnectionHelper
is an all static class which provides
a centralized location from which all SQLConnection
instances
can be managed and retrieved.
SQLConnectionHelper
utilizes the nativePath
property of a File
object used to create the connection.
This is utilized to uniquely identify each cached SQLConnection
database instance within the connections map.
Method | Defined by | ||
---|---|---|---|
close(databasePath:String):void
[static]
Closes the connection to the previously cached
SQLConnection
instance. | SQLConnectionHelper | ||
getConnection(name:String):SQLConnection
[static]
Retrieves a managed
SQLConnection instance based on the
unique name of the database, i.e. | SQLConnectionHelper |
Constant | Defined by | ||
---|---|---|---|
connections : Dictionary [static]
Contains a mapping of each unique
SQLConnection instance
| SQLConnectionHelper |
close | () | method |
public static function close(databasePath:String):void
Closes the connection to the previously cached SQLConnection
instance.
databasePath:String — The database path of the SQLConnection
|
— UnmanagedSQLConnectionException
|
SQLConnectionHelper
can be utilized to close a shared SQLConnection
var databasePath:String = File.userDirectory.nativePath + File.separator + "foo.db" SQLConnectionHelper.close( databasePath );
getConnection | () | method |
public static function getConnection(name:String):SQLConnection
Retrieves a managed SQLConnection
instance based on the
unique name of the database, i.e. File.nativePath
.
Typically the unique name of the database is based on the nativePath
property File
of the connections associated File
object
name:String — unique name of the SQLConnection database
|
SQLConnection — managed SQLConnection instance
|
SQLConnectionHelper
can be utilized to retrieve a reference to a shared SQLConnection
var databasePath:String = File.userDirectory.nativePath + File.separator + "foo.db" var connection:SQLConnection = SQLConnectionHelper.getConnection( databasePath );
connections | constant |
protected static const connections:Dictionary
Contains a mapping of each unique SQLConnection
instance