commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7161 - in trunk/gnue-common/src/datasources/drivers: Base Base/S


From: reinhard
Subject: [gnue] r7161 - in trunk/gnue-common/src/datasources/drivers: Base Base/Schema DBSIG2 DBSIG2/Schema adodbapi adodbapi/Extensions adodbapi/Schema adodbapi/Schema/Creation adodbapi/Schema/Discovery adodbapi/adodbapi appserver appserver/Extensions appserver/Schema appserver/Schema/Creation appserver/Schema/Discovery csv csv/Extensions csv/Schema csv/Schema/Creation csv/Schema/Discovery csv/csv db2 db2/Extensions db2/Schema db2/Schema/Creation db2/Schema/Discovery db2/db2 dbf dbf/Extensions dbf/Schema dbf/Schema/Creation dbf/Schema/Discovery dbf/dbf gadfly gadfly/Extensions gadfly/Schema gadfly/Schema/Creation gadfly/Schema/Discovery gadfly/gadfly informix informix/Extensions informix/Schema informix/Schema/Creation informix/Schema/Discovery informix/informix ingres ingres/Extensions ingres/Schema ingres/Schema/Creation ingres/Schema/Discovery ingres/ingres interbase interbase/Extensions interbase/Schema interbase/Schema/Discovery interbase/interbase ldap mysql mysql/Extensions mysql/Schema mysql/Schema/Discovery mysql/mysql odbc odbc/wodbc oracle oracle/Base oracle/Extensions oracle/Schema oracle/Schema/Creation oracle/Schema/Discovery oracle/cxoracle oracle/dcoracle postgresql postgresql/Base postgresql/Extensions postgresql/Schema postgresql/Schema/Discovery postgresql/psycopg postgresql/pygresql postgresql/pypgsql sapdb sapdb/Extensions sapdb/Schema sapdb/Schema/Creation sapdb/Schema/Discovery sapdb/sapdb special special/configfile special/static special/unbound sqlite sqlite/Extensions sqlite/Schema sqlite/Schema/Creation sqlite/Schema/Discovery sqlite/sqlite sqlrelay sqlrelay/sqlrelay sybase sybase/Extensions sybase/Schema sybase/Schema/Creation sybase/Schema/Discovery sybase/sybase
Date: Thu, 10 Mar 2005 17:24:18 -0600 (CST)

Author: reinhard
Date: 2005-03-10 17:24:14 -0600 (Thu, 10 Mar 2005)
New Revision: 7161

Modified:
   trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
   trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/Base/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/DBSIG2/__init__.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/Info.py
   
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
   
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/__init__.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/DataObject.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Info.py
   trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/__init__.py
   trunk/gnue-common/src/datasources/drivers/appserver/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/appserver/Info.py
   
trunk/gnue-common/src/datasources/drivers/appserver/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/appserver/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/appserver/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/appserver/__init__.py
   trunk/gnue-common/src/datasources/drivers/csv/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/csv/Info.py
   trunk/gnue-common/src/datasources/drivers/csv/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/csv/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/csv/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/csv/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/csv/__init__.py
   trunk/gnue-common/src/datasources/drivers/csv/csv/Connection.py
   trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
   trunk/gnue-common/src/datasources/drivers/csv/csv/Info.py
   trunk/gnue-common/src/datasources/drivers/csv/csv/__init__.py
   trunk/gnue-common/src/datasources/drivers/db2/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/db2/Info.py
   trunk/gnue-common/src/datasources/drivers/db2/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/db2/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/db2/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/db2/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/db2/__init__.py
   trunk/gnue-common/src/datasources/drivers/db2/db2/Connection.py
   trunk/gnue-common/src/datasources/drivers/db2/db2/Info.py
   trunk/gnue-common/src/datasources/drivers/db2/db2/__init__.py
   trunk/gnue-common/src/datasources/drivers/dbf/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/dbf/Info.py
   trunk/gnue-common/src/datasources/drivers/dbf/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/dbf/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/dbf/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/dbf/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/dbf/__init__.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/Connection.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/Info.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/dbf/dbf/__init__.py
   trunk/gnue-common/src/datasources/drivers/gadfly/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/gadfly/Info.py
   trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/gadfly/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/gadfly/__init__.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/Connection.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/DataObject.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/Info.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/__init__.py
   trunk/gnue-common/src/datasources/drivers/informix/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/informix/Info.py
   
trunk/gnue-common/src/datasources/drivers/informix/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/informix/Schema/Discovery/Introspection.py
   
trunk/gnue-common/src/datasources/drivers/informix/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/informix/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/informix/__init__.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/Connection.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/DataObject.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/Info.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/informix/informix/__init__.py
   trunk/gnue-common/src/datasources/drivers/ingres/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/ingres/Info.py
   trunk/gnue-common/src/datasources/drivers/ingres/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/ingres/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/ingres/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/ingres/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/ingres/__init__.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/Connection.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/DataObject.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/Info.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/ingres/ingres/__init__.py
   trunk/gnue-common/src/datasources/drivers/interbase/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/interbase/Info.py
   
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/Introspection.py
   
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/interbase/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/interbase/__init__.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/DataObject.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/Info.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/interbase/interbase/__init__.py
   trunk/gnue-common/src/datasources/drivers/ldap/Driver.py
   trunk/gnue-common/src/datasources/drivers/ldap/Info.py
   trunk/gnue-common/src/datasources/drivers/ldap/__init__.py
   trunk/gnue-common/src/datasources/drivers/mysql/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/mysql/Info.py
   trunk/gnue-common/src/datasources/drivers/mysql/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/mysql/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/mysql/__init__.py
   trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
   trunk/gnue-common/src/datasources/drivers/mysql/mysql/DataObject.py
   trunk/gnue-common/src/datasources/drivers/mysql/mysql/Info.py
   trunk/gnue-common/src/datasources/drivers/mysql/mysql/__init__.py
   trunk/gnue-common/src/datasources/drivers/odbc/Info.py
   trunk/gnue-common/src/datasources/drivers/odbc/__init__.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/Connection.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/DataObject.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/Info.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/odbc/wodbc/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py
   trunk/gnue-common/src/datasources/drivers/oracle/Base/DataObject.py
   trunk/gnue-common/src/datasources/drivers/oracle/Base/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/oracle/Base/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/Info.py
   trunk/gnue-common/src/datasources/drivers/oracle/Schema/Creation/Creation.py
   trunk/gnue-common/src/datasources/drivers/oracle/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Driver.py
   trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Info.py
   trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/__init__.py
   trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Driver.py
   trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Info.py
   trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Base/DataObject.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Base/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Info.py
   
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Driver.py
   trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Info.py
   trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Driver.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Info.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/__init__.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Driver.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Info.py
   trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/Schema/Creation/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/__init__.py
   trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py
   trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/__init__.py
   trunk/gnue-common/src/datasources/drivers/special/Info.py
   trunk/gnue-common/src/datasources/drivers/special/__init__.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/Connection.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/DataObject.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/Info.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/special/configfile/__init__.py
   trunk/gnue-common/src/datasources/drivers/special/static/Connection.py
   trunk/gnue-common/src/datasources/drivers/special/static/DataObject.py
   trunk/gnue-common/src/datasources/drivers/special/static/Info.py
   trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/special/static/__init__.py
   trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
   trunk/gnue-common/src/datasources/drivers/special/unbound/Info.py
   trunk/gnue-common/src/datasources/drivers/special/unbound/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/Info.py
   trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/Info.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/__init__.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/Connection.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/DataObject.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/Info.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/__init__.py
   trunk/gnue-common/src/datasources/drivers/sybase/Extensions/__init__.py
   trunk/gnue-common/src/datasources/drivers/sybase/Info.py
   trunk/gnue-common/src/datasources/drivers/sybase/Schema/Creation/__init__.py
   
trunk/gnue-common/src/datasources/drivers/sybase/Schema/Discovery/Introspection.py
   trunk/gnue-common/src/datasources/drivers/sybase/Schema/Discovery/__init__.py
   trunk/gnue-common/src/datasources/drivers/sybase/Schema/__init__.py
   trunk/gnue-common/src/datasources/drivers/sybase/__init__.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/Connection.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/DataObject.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/Info.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/RecordSet.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/ResultSet.py
   trunk/gnue-common/src/datasources/drivers/sybase/sybase/__init__.py
Log:
Adapted all DBSIG2 based Connection objects to match the improved base class,
added lots of comments and docstrings.



Property changes on: 
trunk/gnue-common/src/datasources/drivers/Base/DataObject.py
___________________________________________________________________
Name: svn:keywords
   - +Id
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   - +Id
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/Base/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py      
2005-03-10 23:24:14 UTC (rev 7161)
@@ -42,8 +42,8 @@
   The base class for all drivers that use DBSIG2 compatible modules.
 
   Driver plugins derived from this driver must subclass this class and
-  overwrite at least the L{_driver} class variable and implement the _connect
-  method as defined in L{Base.Connection.Connection._connect}.
+  overwrite at least the L{_driver} class variable and implement the
+  L{_getConnectParams} method.
 
   @cvar _driver: The loaded Python module of the DBSIG2 driver. Must be
     overwritten by descendants.
@@ -344,6 +344,21 @@
 
 
   # ---------------------------------------------------------------------------
+  # This method has to be overwritten by descendants
+  # ---------------------------------------------------------------------------
+
+  def _getConnectParams (self, connectData):
+    """
+    Return a tuple with a list and a dictionary, being the parameters and
+    keyword arguments to be passed to the connection function of the DBSIG2
+    driver.
+
+    This method must be overwritten by all descendants.
+    """
+    return ([], {})
+
+
+  # ---------------------------------------------------------------------------
   # Implementations of virtual methods
   # ---------------------------------------------------------------------------
 
@@ -352,6 +367,15 @@
 
   # ---------------------------------------------------------------------------
 
+  def _connect (self, connectData):
+    (params, kwargs) = self._getConnectParams (connectData)
+    try:
+      self.native = self._driver.connect (*params, **kwargs)
+    except self._driver.DatabaseError:
+      raise Exceptions.LoginError, errors.getException () [2]
+
+  # ---------------------------------------------------------------------------
+
   def _commit (self):
     try:
       self.native.commit ()


Property changes on: 
trunk/gnue-common/src/datasources/drivers/DBSIG2/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/DBSIG2/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/DBSIG2/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/DBSIG2/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/DBSIG2/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/adodbapi/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py   
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py   
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - ADO DB Driver - Connection
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,31 +19,16 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# adodbapi/Connection.py
-#
-# DESCRIPTION:
-# Driver to provide access to data via adodbapi Driver
-#
-# NOTES:
-#
+# $Id$
 
 __all__ = ['Connection']
 
-####                                   ####
-#### IF YOU MODIFY ANY CONNECTION      ####
-#### ATTRIBUTES, PLEASE UPDATE info.py ####
-####                                   ####
+import string
 
-from gnue.common.datasources import Exceptions, GConditions, GConnections
-from gnue.common.apps import GDebug
-from gnue.common.datasources.drivers import DBSIG2
-from DataObject import *
+from gnue.common.datasources import GConnections
 
 try:
-  import adodbapi as SIG2api
+  import adodbapi
 except ImportError:
   raise GConnections.DependencyError, ('adodbapi', None)
 
@@ -49,39 +37,50 @@
 except ImportError:
   raise GConnections.DependencyError, ('win32com', None)
 
+from gnue.common.datasources.drivers import DBSIG2
 from gnue.common.datasources.drivers.adodbapi.Schema.Discovery.Introspection 
import Introspection
 
-class Connection(DBSIG2.Connection):
+import DataObject
+
+
+# =============================================================================
+# ADO Connection class
+# =============================================================================
+
+class Connection (DBSIG2.Connection):
+  """
+  Connection class for ADO databases.
+  """
+
+  _driver = adodbapi
+
   defaultBehavior = Introspection
-  _driver = SIG2api
-  _DatabaseError = SIG2api.DatabaseError
+
   supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
+    'object': DataObject.DataObject_Object,
+    'sql':    DataObject.DataObject_SQL
   }
 
-  def connect(self, connectData={}):
-    GDebug.printMesg(9,"Adodbapi database driver initializing")
+  # ---------------------------------------------------------------------------
+  # Build up parameters for connect method
+  # ---------------------------------------------------------------------------
 
-    try:
-      connPar = {'Provider': connectData['oledb_provider'],
-                      'Data Source' : connectData['data_source'],
-                      'User Id' : connectData['_username'],
-                      'Password' : connectData['_password']
-                     }
-      # optional parameters for MS SQL Server
-      for gnueName, oledbName in [('initial_catalog', 'Initial Catalog'),
-                                              ('network_library', 'Network 
Library'),
-                                              ('data_provider', 'Data 
Provider'),
-                                              ]:
-          if connectData.has_key(gnueName):
-              connPar[oledbName] = connectData[gnueName]
+  def _getConnectParams (self, connectData):
 
-      connStr = ';'.join([r"%s=%s" % (k,v) for k,v in connPar.items()])
-      GDebug.printMesg(9,'Adodbapi connection string="%s"' % connStr)
+    # mandatory parameters
+    params = {'Provider'   : connectData ['oledb_provider'],
+              'Data Source': connectData ['data_source'],
+              'User Id'    : connectData ['_username'],
+              'Password'   : connectData ['_password']}
 
-      self.native = SIG2api.connect(connStr)
+    # optional parameters
+    for gnueName, oledbName in [('initial_catalog', 'Initial Catalog'),
+                                ('network_library', 'Network Library'),
+                                ('data_provider'  , 'Data Provider'  )]:
+      if connectData.has_key (gnueName):
+        params [oledbName] = connectData [gnueName]
 
-    except self._DatabaseError, value:
-      raise Exceptions.LoginError, value
+    p = ["%s=%s" % (k, v) for (k, v) in params.items ()]
+    connectstring = string.join (p, ';'))
 
+    return ([connectstring], {})


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/adodbapi/adodbapi/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/appserver/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/appserver/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/appserver/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/appserver/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/appserver/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/appserver/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/csv/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/csv/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/csv/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/csv/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/csv/csv/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/csv/csv/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/db2/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/db2/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/db2/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/db2/db2/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/db2/db2/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/dbf/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/dbf/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/dbf/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/dbf/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/dbf/dbf/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/dbf/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/dbf/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/dbf/dbf/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/gadfly/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/gadfly/gadfly/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/informix/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/informix/informix/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/ingres/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/ingres/ingres/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/interbase/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/Introspection.py
===================================================================
--- 
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/Introspection.py
       2005-03-10 22:15:17 UTC (rev 7160)
+++ 
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/Introspection.py
       2005-03-10 23:24:14 UTC (rev 7161)
@@ -25,7 +25,6 @@
 
 import string
 import re
-import kinterbasdb
 
 from gnue.common.datasources import GIntrospection
 
@@ -236,8 +235,4 @@
   # ---------------------------------------------------------------------------
 
   def __identifier (self, name):
-    #if kinterbasdb.__version__ [:3] == (3, 0, 1):
-      #return name.upper ()
-    #else:
-      #return name
     return name.upper ()


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - Interbase DB Driver - Connection
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,111 +19,88 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# interbase/DBdriver.py
-#
-# DESCRIPTION:
-# Driver to provide access to data via the Kinterbasdb Interbase/Firebird 
Python Driver
-# Requires Kinterbasdb > 3.0 (http://kinterbasdb.sourceforge.net/)
-#
-# NOTES:
-#
-#   Supported attributes (via connections.conf or <database> tag)
-#
-#     host=      This is the Interbase host for your connection  (required)
-#     dbame=      This is the Interbase database to use (required)
-#
 # $Id$
 
 __all__ = ['Connection']
 
-####                                   ####
-#### IF YOU MODIFY ANY CONNECTION      ####
-#### ATTRIBUTES, PLEASE UPDATE info.py ####
-####                                   ####
+from gnue.common.datasources import GConnections
 
-from string import upper, lower, rstrip
-import sys
-import types
-from gnue.common.datasources import Exceptions, GConditions, GConnections
-from gnue.common.apps import errors, i18n
-from gnue.common.datasources.drivers import DBSIG2
-from DataObject import *
-from gnue.common.datasources.drivers.interbase.Schema.Discovery.Introspection 
import Introspection
-from gnue.common.datasources.drivers.interbase.Schema.Creation.Creation \
-    import Creation
-
 try:
-  import kinterbasdb as SIG2api
+  import kinterbasdb
 except ImportError:
   raise GConnections.DependencyError, ('Kinterbasdb', None)
 
+from gnue.common.datasources.drivers import DBSIG2
+from gnue.common.datasources.drivers.interbase.Schema.Creation.Creation import 
Creation
+from gnue.common.datasources.drivers.interbase.Schema.Discovery.Introspection 
import Introspection
 
-######################################################################
-#
-#  GConnection object for Interbase drivers
-#
+import DataObject
+
+
+# =============================================================================
+# Interbase Connection class
+# =============================================================================
+
 class Connection (DBSIG2.Connection):
+  """
+  Connection class for Interbase databases.
+  """
 
+  _driver            = kinterbasedb
   _boolean_true      = 1
   _boolean_false     = 0
   _numbers_as_string = False
+
   defaultBehavior    = Introspection
   defaultCreator     = Creation
-  _driver            = SIG2api
-  _DatabaseError     = SIG2api.DatabaseError
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
+
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject.DataObject_SQL}
+
+  # TODO: Can be removed once everything is switched to parameters
   # The date/time format used in insert/select statements
   # (based on format used for time.strftime())
   _dateTimeFormat = "cast('%Y-%m-%d %H:%M:%S' as timestamp)"
 
+
   # ---------------------------------------------------------------------------
-  # Establish a new connection
+  # Constructor
   # ---------------------------------------------------------------------------
 
-  def connect(self, connectData={}):
+  def __init__ (self, connections, name, parameters):
 
-    gDebug (9, "Interbase database driver initializing")
+    DBSIG2.Connection.__init__ (self, connections, name, parameters)
 
-    try:
-      ib_encoding = ib_encTable [self._encoding]
+    # Find out encoding for Interbase
+    if ib_encTable.has_key (self._encoding):
+      self._ib_encoding = ib_encTable [self._encoding]
+    else:
+      self._ib_encoding = ''
+      gDebug (1, "Encoding '%s' is not supported by interbase dbdriver. "
+                 "Using default encoding." % self._encoding)
 
-    except KeyError:
-      gDebug (1, u_("Encoding '%s' is not supported by interbase "
-                              "dbdriver. Using default encoding.") % \
-                              self._encoding)
-      ib_encoding = ''
 
-    if ib_encoding:
-      gDebug (9, u_("Setting interbase client_encoding to %(new)s (%(old)s)") \
-                 % {'new': ib_encoding, 'old': self._encoding})
+  # ---------------------------------------------------------------------------
+  # Get connection parameters
+  # ---------------------------------------------------------------------------
 
-    try:
-      username = connectData ['_username']
-      password = connectData ['_password']
+  def _getConnectParams (self, connectData):
 
-      if isinstance (username, types.UnicodeType):
-        username = username.encode (i18n.getencoding ())
-      if isinstance (password, types.UnicodeType):
-        password = password.encode (i18n.getencoding ())
+    # mandatory parameters
+    kwargs = {'database': connectData ['dbname'],
+              'user'    : connectData ['_username'],
+              'password': connectData ['_password']}
 
-      self.native = SIG2api.connect ( \
-                            user     = username,
-                            password = password,
-                            charset  = ib_encoding,
-                            database = connectData ['dbname'],
-                            host     = connectData ['host'])
+    # optional parameters
+    for gnueName, ibName in [('host', 'host')]:
+      if connectData.has_key (gnueName):
+        kwargs [ibName] = connectData [gnueName]
 
-      # automatically start a new transaction
-      self._beginTransaction ()
+    # character set
+    if self._ib_encoding:
+      kwargs ['charset'] = self._ib_encoding
 
-    except self._DatabaseError:
-      raise Exceptions.LoginError, errors.getException () [2]
+    return ([], kwargs)
 
 
   # ---------------------------------------------------------------------------
@@ -136,7 +116,7 @@
   # ---------------------------------------------------------------------------
 
   def getTimeStamp (self):
-    return self.__singleQuery ("SELECT CAST('now' AS DATE) FROM rdb$database")
+    return self.sql1 ("SELECT CAST('now' AS DATE) FROM rdb$database")
 
 
   # ---------------------------------------------------------------------------
@@ -144,40 +124,13 @@
   # ---------------------------------------------------------------------------
 
   def getSequence (self, name):
-    return self.__singleQuery ("SELECT gen_id(%s,1) FROM rdb$database" % name)
+    return self.sql1 ("SELECT gen_id(%s,1) FROM rdb$database" % name)
 
 
-  # ---------------------------------------------------------------------------
-  # Execute an SQL statement for internal use only
-  # ---------------------------------------------------------------------------
+# =============================================================================
+# Encoding-Table 
+# =============================================================================
 
-  def __singleQuery (self, statement):
-    cursor = self.native.cursor ()
-
-    try:
-      cursor.execute (statement)
-      rv = cursor.fetchone ()
-      cursor.close ()
-
-    except mesg:
-      gDebug (1, "**** Unable to execute extension query")
-      gDebug (1, "**** %s" % mesg)
-
-      try:
-        cursor.close ()
-
-      except:
-        pass
-
-      return None
-
-    try:
-      return rv [0]
-
-    except:
-      return None
-
-
 # RDB$CHARACTER_SETS.RDB$CHARACTER_SET_NAME
 ib_encTable =  {'ascii'     :  'ASCII',
                 ''          :  'BIG_5',


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/interbase/interbase/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/ldap/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/ldap/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/ldap/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/mysql/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/mysql/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - MySQL DB Driver - Connection
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,31 +19,12 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# mysql/DBdriver.py
-#
-# DESCRIPTION:
-# Driver to provide access to data vi MySQL
-#
-# NOTES:
-# Supports transactions if the MySQL server is compiled w/transaction support
-# (which it does NOT by default)
+# $Id$
 
 __all__ = ['Connection']
 
-####                                   ####
-#### IF YOU MODIFY ANY CONNECTION      ####
-#### ATTRIBUTES, PLEASE UPDATE info.py ####
-####                                   ####
+from gnue.common.datasources import GConnections
 
-import string
-import sys
-import types
-from gnue.common.datasources import Exceptions, GConditions, GConnections
-from gnue.common.apps import i18n, errors
-
 try:
   import MySQLdb
 except ImportError:
@@ -48,69 +32,71 @@
                                 'http://sourceforge.net/projects/mysql-python')
 
 from gnue.common.datasources.drivers import DBSIG2
-from DataObject import *
+from gnue.common.datasources.drivers.mysql.Schema.Creation.Creation import 
Creation
 from gnue.common.datasources.drivers.mysql.Schema.Discovery.Introspection 
import Introspection
-from gnue.common.datasources.drivers.mysql.Schema.Creation.Creation import \
-    Creation
 
+import DataObject
 
-######################################################################
-#
-#  GConnection object for PostgreSQL-based drivers
-#
-class Connection(DBSIG2.Connection):
 
+# =============================================================================
+# MySQL Connection class
+# =============================================================================
+
+class Connection (DBSIG2.Connection):
+  """
+  Connection class for Interbase databases.
+  """
+
   _driver = MySQLdb
+
   defaultBehavior = Introspection
   defaultCreator  = Creation
-  _DatabaseError = MySQLdb.DatabaseError
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
 
-  def connect(self, connectData={}):
-    gDebug (9,"Mysql database driver initializing")
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject.DataObject_SQL}
 
-    # 1. just allow string type username/password 2. None -> ''
-    user   = connectData ['_username'] or ''
-    passwd = connectData ['_password'] or ''
+  # ---------------------------------------------------------------------------
+  # Get connection parameters
+  # ---------------------------------------------------------------------------
 
-    if isinstance (user, types.UnicodeType):
-      user = user.encode (i18n.getencoding ())
-    if isinstance (passwd, types.UnicodeType):
-      passwd = passwd.encode (i18n.getencoding ())
+  def _getConnectParams (self, connectData):
 
-    try:
-      self.native = MySQLdb.connect(user   = user,
-                                    passwd = passwd,
-                                    host   = connectData ['host'],
-                                    db     = connectData ['dbname'])
+    # mandatory parameters
+    kwargs = {'db'    : connectData ['dbname'],
+              'user'  : connectData ['_username'],
+              'passwd': connectData ['_password']}
 
-    except self._DatabaseError, value:
-      raise Exceptions.LoginError, \
-          u_("The MySQL driver returned the following error:\n%s") \
-          % errors.getException () [2]
+    # optional parameters
+    for gnueName, ibName in [('host', 'host')]:
+      if connectData.has_key (gnueName):
+        kwargs [ibName] = connectData [gnueName]
 
-    self._beginTransaction()
+    return ([], kwargs)
 
 
-  def _beginTransaction(self):
+  # ---------------------------------------------------------------------------
+  # Start a new transaction
+  # ---------------------------------------------------------------------------
+
+  def _beginTransaction (self):
+    # only available if MySQL is compiled with transaction support
     try:
-      self.native.begin()
+      self.native.begin ()
     except:
       pass
 
 
-  #########
-  #
-  # Extensions to the basic GConnection object
-  #
-
+  # ---------------------------------------------------------------------------
   # Return the current date, according to database
-  def getTimeStamp(self):
+  # ---------------------------------------------------------------------------
+
+  def getTimeStamp (self):
     return self.sql1 ("select current_timestamp")
 
+
+  # ---------------------------------------------------------------------------
   # Return a sequence number from sequence 'name'
-  #def getSequence(self, name):
-  #  raise "Not supported"
+  # ---------------------------------------------------------------------------
+
+  # def getSequence (self, name):
+  #   (not available in MySQL)


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/mysql/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/mysql/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/mysql/mysql/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/odbc/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/odbc/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/odbc/wodbc/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - Generic Oracle DB driver - Connection
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,111 +19,75 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# Oracle/Base/Connection.py
-#
-# DESCRIPTION:
-"""
-Driver to provide access to data via Computronix's Oracle/Python Driver
-Requires cx_Oracle 2.2+ (http://www.computronix.com/utilities/)
-"""
-#
-# NOTES:
-#
-#   Supported attributes (via connections.conf or <database> tag)
-#
-#     service=    This is the Oracle TNS name for your connection  (required)
-#
+# $Id$
 
 __all__ = ['Connection']
 
-import os, sys, string, types
-from gnue.common.datasources import Exceptions, GConditions
-from gnue.common.apps import i18n, errors
+import os
 from gnue.common.datasources.drivers import DBSIG2
 from gnue.common.datasources.drivers.oracle.Schema.Discovery.Introspection 
import Introspection
-from DataObject import *
 
+import DataObject
 
-#
-#  Extensions to Trigger Namespaces
-#
-class Connection(DBSIG2.Connection):
 
+# =============================================================================
+# Generic Oracle Connection class
+# =============================================================================
+
+class Connection (DBSIG2.Connection):
+  """
+  Generic Connection class for PostgreSQL databases.
+  """
+
   defaultBehavior = Introspection
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
 
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject.DataObject_SQL}
+
   _dateTimeFormat = "'%Y-%m-%d %H:%M:%S'"
 
-  #
-  # Connect to database
-  def connect(self, connectData={}):
-    gDebug (9,"Oracle database driver initializing")
 
-    if not hasattr(self,'_DatabaseError'):
-      self._DatabaseError = self._driver.DatabaseError
+  # ---------------------------------------------------------------------------
+  # Constructor
+  # ---------------------------------------------------------------------------
 
-    if connectData.has_key('oracle_home'):
-      os.environ['ORACLE_HOME'] = connectData['oracle_home']
+  def __init__ (self, connections, name, parameters):
 
-    user   = connectData ['_username']
-    passwd = connectData ['_password']
+    DBSIG2.Connection.__init__ (self, connections, name, parameters)
 
-    if isinstance (user, types.UnicodeType):
-      user = user.encode (i18n.getencoding ())
-    if isinstance (passwd, types.UnicodeType):
-      passwd = passwd.encode (i18n.getencoding ())
+    if parameters.has_key ('oracle_home'):
+      os.environ ['ORACLE_HOME'] = parameters ['oracle_home']
 
+    if parameters.has_key ('datetimeformat'):
+      self._dateTimeFormat = "'%s'" % connectData ['datetimeformat']
 
-    try:
-      self.native = self._driver.connect("%s/address@hidden" \
-                % (user, \
-                   passwd, \
-                   connectData['service']))
-    except self._DatabaseError, value:
-      raise Exceptions.LoginError, \
-          u_("The Oracle driver returned the following error:\n%s") \
-          % errors.getException () [2]
 
-    if connectData.has_key('datetimeformat'):
-      self._dateTimeFormat = "'%s'" % connectData['datetimeformat']
+  # ---------------------------------------------------------------------------
+  # Get connection parameters
+  # ---------------------------------------------------------------------------
 
+  def _getConnectParams (self, connectData):
 
-  #
-  #  Extensions
-  #
+    connectstring = "%s/address@hidden" % (connectData ['_username'],
+                                  connectData ['_password'],
+                                  connectData ['service'])
 
-  # Return the current date, according to database
-  def getTimeStamp(self):
-    return self.__singleQuery("select sysdate from dual")
+    return ([connectstring], {})
 
-  # Return a sequence number from sequence 'name'
-  def getSequence(self, name):
-    return self.__singleQuery("select %s.nextval from dual" % name)
 
-  # Used internally
-  def __singleQuery(self, statement):
-    cursor = self.native.cursor()
-    try:
-      cursor.execute(statement)
-      rv = cursor.fetchone()
-      cursor.close()
-    except mesg:
-      gDebug (1,"**** Unable to execute extension query")
-      gDebug (1,"**** %s" % mesg)
-      cursor.close()
-      return None
+  # ---------------------------------------------------------------------------
+  # Return the current date, according to database
+  # ---------------------------------------------------------------------------
 
-    try:
-      return rv[0]
-    except:
-      return None
+  def getTimeStamp (self):
 
+    return self.sql1 ("select sysdate from dual")
 
 
+  # ---------------------------------------------------------------------------
+  # Return a sequence number from sequence 'name'
+  # ---------------------------------------------------------------------------
 
+  def getSequence (self, name):
+
+    return self.sql1 ("select %s.nextval from dual" % name)


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Base/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Base/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Base/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Base/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/oracle/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Creation/Creation.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Driver.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Driver.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - Oracle DB driver using cxoracle
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,26 +19,25 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# cxoracle/DBdriver.py
-#
-# DESCRIPTION:
-#
-# NOTES:
-#
+# $Id$
 
+__all__ = ('Connection')
 
 from gnue.common.datasources import GConnections
 from gnue.common.datasources.drivers.oracle import Base
 
 try:
-  import cx_Oracle as SIG2api
+  import cx_Oracle
 except ImportError:
   raise GConnections.DependencyError, ('cx_Oracle', None)
 
-class Connection(Base.Connection):
-  _driver = SIG2api
-  _DatabaseError = SIG2api.DatabaseError
 
+# =============================================================================
+# Oracle Connection class using cxoracle
+# =============================================================================
+
+class Connection (Base.Connection):
+  """
+  Connection class for Oracle databases using the cxoracle DBSIG2 driver.
+  """
+  _driver = cx_Oracle


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/cxoracle/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Driver.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Driver.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,41 +1,43 @@
+# GNU Enterprise Common Library - Oracle DB driver using cxoracle
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
-# GNU Enterprise is free software; you can redistribute it 
-# and/or modify it under the terms of the GNU General Public 
-# License as published by the Free Software Foundation; either 
+# This file is part of GNU Enterprise
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
 # version 2, or (at your option) any later version.
 #
-# GNU Enterprise is distributed in the hope that it will be 
-# useful, but WITHOUT ANY WARRANTY; without even the implied 
-# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 # PURPOSE. See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public 
+# You should have received a copy of the GNU General Public
 # License along with program; see the file COPYING. If not,
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# oracle/DBdriver.py
-#
-# DESCRIPTION:
-#
-# NOTES:
-#
+# $Id$
 
+__all__ = ('Connection')
 
 from gnue.common.datasources import GConnections
 from gnue.common.datasources.drivers.oracle import Base
 
 try:
-  import DCOracle2 as SIG2api
+  import DCOracle2
 except ImportError:
   raise GConnections.DependencyError ('DCOracle2', None)
 
-class Connection(Base.Connection):
-  _driver = SIG2api
-  _DatabaseError = SIG2api.DatabaseError
 
+# =============================================================================
+# Oracle Connection class using dcoracle
+# =============================================================================
+
+class Connection (Base.Connection):
+  """
+  Connection class for Oracle databases using the cxoracle DBSIG2 driver.
+  """
+  _driver = DCOracle2


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/oracle/dcoracle/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py     
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/Base/Connection.py     
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,4 +1,4 @@
-# GNU Enterprise Common - Database Drivers - Base driver for PostgreSQL
+# GNU Enterprise Common Library - Generic Postgres DB driver - Connection
 #
 # Copyright 2001-2005 Free Software Foundation
 #
@@ -23,85 +23,71 @@
 
 __all__ = ['Connection']
 
-import types
-
-from gnue.common.apps import errors, i18n
-from gnue.common.datasources import Exceptions
 from gnue.common.datasources.drivers import DBSIG2
-from DataObject import *
-
-from gnue.common.datasources.drivers.postgresql.Schema.Discovery.Introspection 
import Introspection
 from gnue.common.datasources.drivers.postgresql.Schema.Creation.Creation 
import Creation
+from gnue.common.datasources.drivers.postgresql.Schema.Discovery.Introspection 
import Introspection
 
+import DataObject
 
 
 # =============================================================================
-# GConnection object for PostgreSQL-based drivers
+# Generic PostgreSQL Connection class
 # =============================================================================
 
 class Connection (DBSIG2.Connection):
+  """
+  Generic Connection class for PostgreSQL databases.
+  """
 
   defaultBehavior = Introspection
   defaultCreator  = Creation
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
 
-  _pg_connectString = 'host=%s dbname=%s user=%s password=%s port=%s'
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject.DataObject_SQL}
 
 
   # ---------------------------------------------------------------------------
-  # Connect to the database
+  # Constructor
   # ---------------------------------------------------------------------------
 
-  def connect (self, connectData):
+  def __init__ (self, connections, name, parameters):
 
-    if not self._driver:
-      self._driver = __import__ (self._driver_module, None, None, '*')
+    DBSIG2.Connection.__init__ (self, connections, name, parameters)
 
-    if not hasattr (self,'_DatabaseError'):
-      try:
-        self._DatabaseError = self._driver.Error
-      except:
-        self._DatabaseError = self._driver.DatabaseError
+    # Find out encoding for Postgres
+    if pg_encTable.has_key (self._encoding):
+      self._pg_encoding = pg_encTable [self._encoding]
+    else:
+      self._pg_encoding = ''
+      gDebug (1, "Encoding '%s' is not supported by postgresql dbdriver. "
+                 "Using default encoding." % self._encoding)
 
-    gDebug (9, "Postgresql database driver initializing")
+    # TODO: can be removed if everything is switched to parameters
+    dtfmt = parameters.get ('datetimeformat', "%Y-%m-%d %H:%M:%S")
+    self._dateTimeFormat = "'%s'" % dtfmt
+    gDebug (9, "datetime-format set to %s" % self._dateTimeFormat)
 
-    try:
-      port   = connectData.get ('port', '5432')
-      conStr = self._pg_connectString % (connectData ['host'],
-                                         connectData ['dbname'],
-                                         connectData ['_username'],
-                                         connectData ['_password'],
-                                         port)
 
-      if isinstance (conStr, types.UnicodeType):
-        conStr = conStr.encode (i18n.getencoding ())
+  # ---------------------------------------------------------------------------
+  # Get connection parameters
+  # ---------------------------------------------------------------------------
 
-      self.native = self._driver.connect (conStr)
+  def _getConnectParams (self, connectData):
 
-    except self._DatabaseError, value:
-      gDebug (1, "Connect String: %s" % conStr)
-      gDebug (1, "Exception %s" % value)
+    # mandatory parameters
+    kwargs = {'database': connectData ['dbname'],
+              'user'    : connectData ['_username'],
+              'password': connectData ['_password']}
 
-      raise Exceptions.LoginError, \
-          u_("The PostgreSQL driver returned the following error:\n\t%s") \
-          % errors.getException () [2]
+    # optional parameters
+    for gnueName, pgName in [('host', 'host'),
+                             ('port', 'port')]:
+      if connectData.has_key (gnueName):
+        kwargs [pgName] = connectData [gnueName]
 
-    self._pg_encoding = pg_encTable.get (self._encoding, '')
-    if not pg_encTable.has_key (self._encoding):
-      gDebug (1, u_("Encoding '%s' is not supported by postgresql dbdriver. "
-                    "Using default encoding.") % self._encoding)
+    return ([], kwargs)
 
-    dtfmt = connectData.get ('datetimeformat', "%Y-%m-%d %H:%M:%S")
-    self._dateTimeFormat = "'%s'" % dtfmt
-    gDebug (9, "datetime-format set to %s" % self._dateTimeFormat)
 
-    # FIXME: Why isn't this generally done for any new connection?
-    self._beginTransaction ()
-
-
   # ---------------------------------------------------------------------------
   # Done at the start of each transaction
   # ---------------------------------------------------------------------------
@@ -111,15 +97,10 @@
     # Must set CLIENT_ENCODING per transaction as it is reset on COMMIT or
     # ROLLBACK.
 
-    if self._pg_encoding not in ["", 'DEFAULT']:
+    if self._pg_encoding not in ['', 'DEFAULT']:
       self.sql ("SET CLIENT_ENCODING TO '%s'" % self._pg_encoding)
 
 
-  # ===========================================================================
-  # Extensions to the basic GConnection object
-  # ===========================================================================
-
-
   # ---------------------------------------------------------------------------
   # Return the current date, according to database
   # ---------------------------------------------------------------------------


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Base/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Base/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Driver.py      
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Driver.py      
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,10 +1,13 @@
+# GNU Enterprise Common Library - Postgres DB driver using psycopg
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
-# version 2, or(at your option) any later version.
+# version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
 # useful, but WITHOUT ANY WARRANTY; without even the implied
@@ -16,29 +19,25 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# popy/DBdriver.py
-#
-# DESCRIPTION:
-# Postgresql implementation of dbdriver using Python DB-SIG v2
-# specification.
-#
-# NOTES:
-#
+# $Id$
 
 __all__ = ('Connection')
 
-from gnue.common.datasources.drivers.postgresql import Base
 from gnue.common.datasources import GConnections
+from gnue.common.datasources.drivers.postgresql import Base
 
 try:
   import psycopg
 except:
   raise GConnections.DependencyError, ('psycopg', None)
 
-#print dir (psycopg)
-class Connection(Base.Connection):
+
+# =============================================================================
+# PostgreSQL Connection class using psycopg
+# =============================================================================
+
+class Connection (Base.Connection):
+  """
+  Connection class for PostgreSQL databases using the psycopg DBSIG2 driver.
+  """
   _driver = psycopg
-#  _DatabaseError = (psycopg.DatabaseError, psycopg.Error, 
psycopg.ProgrammingError)


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Info.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Info.py        
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Info.py        
2005-03-10 23:24:14 UTC (rev 7161)
@@ -43,9 +43,9 @@
 
 Connection Properties
 ---------------------
+* dbname -- This is the database to use (required)
 * host  -- This is the name of the database host, or, on Linux,
-  directory containing the network socket (required)
-* dbname -- This is the database to use (required)
+  directory containing the network socket (optional)
 * port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
 
 Examples


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/psycopg/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: 
trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Driver.py     
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Driver.py     
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,10 +1,13 @@
+# GNU Enterprise Common Library - Postgres DB driver using PyGreSQL
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
-# version 2, or(at your option) any later version.
+# version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
 # useful, but WITHOUT ANY WARRANTY; without even the implied
@@ -16,51 +19,25 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# postgresql/Connection.py
-#
-# DESCRIPTION:
-# Postgresql implementation of dbdriver using Python DB-SIG v2
-# specification.
-#
-# NOTES:
-#
+# $Id$
 
 __all__ = ('Connection')
 
-from gnue.common.datasources import Exceptions, GConditions, GConnections
-from gnue.common.apps import GDebug
+from gnue.common.datasources import GConnections
+from gnue.common.datasources.drivers.postgresql import Base
 
 try:
   import pgdb
-  from _pg import error as PGError   # This is so we can catch login errors
 except ImportError:
   raise GConnections.DependencyError, ('pygresql', None)
 
-from gnue.common.datasources.drivers.postgresql import Base
 
-class Connection(Base.Connection):
-  _driver = pgdb
-  _DatabaseError = pgdb.Error
+# =============================================================================
+# PostgreSQL Connection class using PyGreSQL
+# =============================================================================
 
-  def connect(self, connectData={}):
-    GDebug.printMesg(9,"Postgresql database driver initializing")
-    try:
-      self.native = pgdb.connect(user=connectData['_username'],
-                   password=connectData['_password'],
-                   host=connectData['host'],
-                   database=connectData['dbname'])
-    except PGError, value:
-      raise Exceptions.LoginError, value
-    except self._DatabaseError, value:
-      raise Exceptions.LoginError, value
-
-    if connectData.has_key ('encoding'):
-      encoding = connectData['encoding']
-      GDebug.printMesg(9,'Setting postgresql client_encoding to %s' % encoding)
-      self.sql ("SET CLIENT_ENCODING TO '%s'" % encoding)
-      self._pg_encoding = encoding
-    else:
-      self._pg_encoding = ''
+class Connection (Base.Connection):
+  """
+  Connection class for PostgreSQL databases using the PyGreSQL DBSIG2 driver.
+  """
+  _driver = pgdb


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Info.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Info.py       
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Info.py       
2005-03-10 23:24:14 UTC (rev 7161)
@@ -41,9 +41,9 @@
 
 Connection Properties
 ---------------------
+* dbname -- This is the database to use (required)
 * host  -- This is the name of the database host, or, on Linux,
-  directory containing the network socket (required)
-* dbname -- This is the database to use (required)
+  directory containing the network socket (optional)
 * port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
 
 Examples


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pygresql/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Driver.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Driver.py      
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Driver.py      
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,10 +1,13 @@
+# GNU Enterprise Common Library - Postgres DB driver using pyPgSQL
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
-# version 2, or(at your option) any later version.
+# version 2, or (at your option) any later version.
 #
 # GNU Enterprise is distributed in the hope that it will be
 # useful, but WITHOUT ANY WARRANTY; without even the implied
@@ -16,17 +19,7 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# FILE:
-# pypgsql/DBdriver.py
-#
-# DESCRIPTION:
-# Postgresql implementation of dbdriver using Python DB-SIG v2
-# specification.
-#
-# NOTES:
-#
+# $Id$
 
 __all__ = ('Connection')
 
@@ -34,16 +27,18 @@
 from gnue.common.datasources.drivers.postgresql import Base
 
 try:
-  try:
-    from pyPgSQL import PgSQL # pyPgSQL 2.0 support
-  except ImportError:
-    # TODO: Re-evaluate the minimum version we support!
-    import PgSQL              # pyPgSQL 1.6 support
+  from pyPgSQL import PgSQL
 except:
   raise GConnections.DependencyError, ('pyPgSQL', None)
 
 
+# =============================================================================
+# PostgreSQL Connection class using pyPgSQL
+# =============================================================================
+
 class Connection (Base.Connection):
+  """
+  Connection class for PostgreSQL databases using the pyPgSQL DBSIG2 driver.
+  """
   _driver = PgSQL
-  _pg_connectString = '%s::%s:%s:%s::%s'
   _broken_fetchmany = True


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Info.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Info.py        
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Info.py        
2005-03-10 23:24:14 UTC (rev 7161)
@@ -46,9 +46,9 @@
 
 Connection Properties
 ---------------------
+* dbname -- This is the database to use (required)
 * host  -- This is the name of the database host, or, on Linux,
-  directory containing the network socket (required)
-* dbname -- This is the database to use (required)
+  directory containing the network socket (optional)
 * port -- Port that PostgreSQL is running on (defaults to 5432) (optional)
 
 Examples


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/postgresql/pypgsql/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sapdb/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sapdb/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sapdb/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sapdb/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/sapdb/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py 
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/Connection.py 
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,4 +1,4 @@
-# GNU Enterprise Common - Database Drivers - Driver for MaxDB/SAP-DB
+# GNU Enterprise Common -  MaxDB/SAP-DB DB driver - Connection
 #
 # Copyright 2001-2005 Free Software Foundation
 #
@@ -23,67 +23,63 @@
 
 __all__ = ['Connection']
 
-from gnue.common.apps import errors, i18n
-from gnue.common.datasources import Exceptions
-from gnue.common.datasources.drivers import DBSIG2
-from DataObject import *
+from gnue.common.datasources import GConnections
 
-import sapdb.dbapi
+try:
+  import sapdb.dbapi
+except ImportError:
+  raise GConnections.DependencyError, ('sapdb', None)
 
-from gnue.common.datasources.drivers.sapdb.Schema.Discovery.Introspection \
-    import Introspection
-from gnue.common.datasources.drivers.sapdb.Schema.Creation.Creation \
-    import Creation
+from gnue.common.datasources.drivers import DBSIG2
+from gnue.common.datasources.drivers.sapdb.Schema.Creation.Creation import 
Creation
+from gnue.common.datasources.drivers.sapdb.Schema.Discovery.Introspection 
import Introspection
 
+import DataObject
 
+
 # =============================================================================
-# Connection object for MaxDB/SAP-DB backends
+# MaxDB/SAP-DB Connection class
 # =============================================================================
 
 class Connection (DBSIG2.Connection):
+  """
+  Connection class for MaxDB and SAP-DB databases.
+  """
 
   _driver            = sapdb.dbapi
-  _DatabaseError     = sapdb.dbapi.DatabaseError
-  _named_as_sequence = True
-  defaultBehavior    = Introspection
-  defaultCreator     = Creation
   _boolean_false     = False
   _boolean_true      = True
   _numbers_as_string = False
+  _named_as_sequence = True
 
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
+  defaultBehavior    = Introspection
+  defaultCreator     = Creation
 
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject.DataObject_SQL}
+
+
   # ---------------------------------------------------------------------------
-  # Connect to the database
+  # Get connection parameters
   # ---------------------------------------------------------------------------
 
-  def connect (self, connectData = {}):
-    """
-    """
+  def _getConnectParams (self, connectData):
 
-    gDebug (9, "SAP database driver initializing")
+    # mandatory parameters
+    # FIXME: would it be possible to use kwargs for these parameters, too?
+    params = [(connectData ['_username']).upper(),
+              connectData ['_password'],
+              connectData ['dbname'],
+              connectData.get ('host', '')]
 
-    try:
-      options = {'autocommit': 'off'}
+    # keyword arguments
+    kwargs = {'autocommit': 'off'}
       
-      for gnueName, sapdbName in [('sqlmode'   , 'sqlmode'),
-                                  ('timeout'   , 'timeout'),
-                                  ('isolation' , 'isolation'),
-                                  ('sqlsubmode', 'component')]:
-        if connectData.has_key (gnueName):
-          options [sapdbName] = connectData [gnueName]
+    for gnueName, sapdbName in [('sqlmode'   , 'sqlmode'),
+                                ('timeout'   , 'timeout'),
+                                ('isolation' , 'isolation'),
+                                ('sqlsubmode', 'component')]:
+      if connectData.has_key (gnueName):
+        kwargs [sapdbName] = connectData [gnueName]
 
-      user   = connectData ['_username'].upper ()
-      passwd = connectData ['_password']
-      dbname = connectData ['dbname']
-      host   = connectData.get ('host', '')
-
-      self.native = sapdb.dbapi.connect (user, passwd, dbname, host, **options)
-
-    except self._DatabaseError:
-      raise Exceptions.LoginError, \
-          u_("The MaxDB/SAP-DB driver returned the following error:\n%s") \
-          % errors.getException () [2]
+    return (params, kwargs)


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sapdb/sapdb/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/special/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/configfile/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/static/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/unbound/Driver.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/unbound/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/special/unbound/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlite/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/sqlite/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlite/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlite/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2005-03-10 22:15:17 UTC (rev 7160)
+++ trunk/gnue-common/src/datasources/drivers/sqlite/sqlite/Connection.py       
2005-03-10 23:24:14 UTC (rev 7161)
@@ -1,6 +1,9 @@
+# GNU Enterprise Common Library - SQLite DB Driver - Connection
 #
-# This file is part of GNU Enterprise.
+# Copyright 2001-2005 Free Software Foundation
 #
+# This file is part of GNU Enterprise
+#
 # GNU Enterprise is free software; you can redistribute it
 # and/or modify it under the terms of the GNU General Public
 # License as published by the Free Software Foundation; either
@@ -16,76 +19,54 @@
 # write to the Free Software Foundation, Inc., 59 Temple Place
 # - Suite 330, Boston, MA 02111-1307, USA.
 #
-# Copyright 2000-2005 Free Software Foundation
-#
-# DESCRIPTION:
-# Driver to provide access to data via SQLite's Python Driver.
-# Requires PySQLite (http://pysqlite.sf.net/)
-#
-# NOTES:
-#
-#   Supported attributes (via connections.conf or <database> tag)
-#
-#     dbname = This is the SQLite database to use (required)
-#
 # $Id$
 
 __all__ = ['Connection']
 
-####                                   ####
-#### IF YOU MODIFY ANY CONNECTION      ####
-#### ATTRIBUTES, PLEASE UPDATE info.py ####
-####                                   ####
+from gnue.common.datasources import GConnections
 
-from gnue.common.apps import errors
-from gnue.common.datasources import Exceptions, GConnections
-from gnue.common.datasources.drivers import DBSIG2
-
-from DataObject import *
-
 try:
-  import sqlite as SIG2api
+  import sqlite
   
   # This is a workaround for a bug in PySQLite. All the following mebers are
   # not imported from main.py in __init__.py 
-  if not hasattr (SIG2api, 'Timestamp') and SIG2api.main.have_datetime:
-    SIG2api.Date               = SIG2api.main.Date
-    SIG2api.Time               = SIG2api.main.Time
-    SIG2api.Timestamp          = SIG2api.main.Timestamp
-    SIG2api.DateFromTicks      = SIG2api.main.DateFromTicks
-    SIG2api.TimeFromTicks      = SIG2api.main.TimeFromTicks
-    SIG2api.TimestampFromTicks = SIG2api.main.TimestampFromTicks
+  if not hasattr (sqlite, 'Timestamp') and sqlite.main.have_datetime:
+    sqlite.Date               = sqlite.main.Date
+    sqlite.Time               = sqlite.main.Time
+    sqlite.Timestamp          = sqlite.main.Timestamp
+    sqlite.DateFromTicks      = sqlite.main.DateFromTicks
+    sqlite.TimeFromTicks      = sqlite.main.TimeFromTicks
+    sqlite.TimestampFromTicks = sqlite.main.TimestampFromTicks
 
-    SIG2api.DateTimeType       = SIG2api.main.DateTimeType
-    SIG2api.DateTimeDeltaType  = SIG2api.main.DateTimeDeltaType
+    sqlite.DateTimeType       = sqlite.main.DateTimeType
+    sqlite.DateTimeDeltaType  = sqlite.main.DateTimeDeltaType
 
 except ImportError:
   raise GConnections.DependencyError, ('SQLitedbapi', None)
 
-from gnue.common.datasources.drivers.sqlite.Schema.Discovery.Introspection \
-    import Introspection
-from gnue.common.datasources.drivers.sqlite.Schema.Creation.Creation \
-    import Creation
+from gnue.common.datasources.drivers import DBSIG2
+from gnue.common.datasources.drivers.sqlite.Schema.Creation.Creation import 
Creation
+from gnue.common.datasources.drivers.sqlite.Schema.Discovery.Introspection 
import Introspection
 
+import DataObject
 
+
 # =============================================================================
-# GConnection object for SQLite driver
+# SQLite Connection class
 # =============================================================================
 
 class Connection (DBSIG2.Connection):
 
-  _driver         = SIG2api
-  _DatabaseError  = SIG2api.DatabaseError
+  _driver            = sqlite
+  _boolean_true      = 1
+  _boolean_false     = 0
+  _numbers_as_string = False
+
   defaultBehavior = Introspection
   defaultCreator  = Creation
-  _boolean_true   = 1
-  _boolean_false  = 0
-  _numbers_as_string = False
 
-  supportedDataObjects = {
-    'object': DataObject_Object,
-    'sql':    DataObject_SQL
-  }
+  supportedDataObjects = {'object': DataObject.DataObject_Object,
+                          'sql':    DataObject_SQL}
 
 
   # ---------------------------------------------------------------------------
@@ -93,67 +74,45 @@
   # ---------------------------------------------------------------------------
 
   def __init__ (self, connections, name, parameters):
-    """
-    This constructor extends the inherited object by the 'noTransactions' flag
-    """
+
     DBSIG2.Connection.__init__ (self, connections, name, parameters)
-    self.noTransactions = False
+    # FIXME: what was the problem with transactions? Comment should go here.
+    self.__noTransactions = parameters.get ('appserver', False)
 
 
-
   # ---------------------------------------------------------------------------
-  # Connect to a given database according to the connectData dictionary
+  # Return a sequence of required login fields
   # ---------------------------------------------------------------------------
 
-  def connect (self, connectData):
+  def _getLoginFields (self):
     """
-    This function creates and returns a new database connection using
-    parameters from the given connectData dictionary.
-
-    @param connectData: dictionary with parameters used for the connection
+    This function returns an empty sequence since SQLite doesn't use any user
+    authentication.
     """
+    return []
 
-    gDebug (9, "SQLite database driver initializing <%s>")
 
-    if not hasattr (self, '_DatabaseError'):
-      try:
-        self._DatabaseError = self._driver.Error
-      except:
-        self._DatabaseError = self._driver.DatabaseError
+  # ---------------------------------------------------------------------------
+  # Get connection parameters
+  # ---------------------------------------------------------------------------
 
-    try:
-      self.noTransactions = connectData.get ('appserver', False)
-      self.native = SIG2api.connect (db         = connectData['dbname'],
-                                     encoding   = self._encoding,
-                                     autocommit = self.noTransactions)
+  def _getConnectParams (self, connectData):
 
-    except self._DatabaseError, value:
-      gDebug (1, "Exception %s" % value)
-      raise Exceptions.LoginError, \
-           u_("The SQLite driver returned the following error:\n\t%s") \
-           % errors.getException () [2]
+    # mandatory parameters
+    kwargs = {'db'        : connectData ['dbname'],
+              'encoding'  : self._encoding,
+              'autocommit': self.__noTransactions}
 
+    return ([], kwargs)
 
+
   # ---------------------------------------------------------------------------
   # Commit a pending transactiona pending transaction
   # ---------------------------------------------------------------------------
 
-  def commit (self):
+  def _commit (self):
     """
     This function performs a commit depending on the current transaction-flag.
     """
-    if not self.noTransactions:
-      DBSIG2.Connection.commit (self)
-
-
-
-  # ---------------------------------------------------------------------------
-  # Return a sequence of required login fields
-  # ---------------------------------------------------------------------------
-
-  def getLoginFields (self):
-    """
-    This function returns an empty sequence since SQLite doesn't use any user
-    authentication.
-    """
-    return []
+    if not self.__noTransactions:
+      DBSIG2.Connection._commit (self)


Property changes on: trunk/gnue-common/src/datasources/drivers/sqlrelay/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sqlrelay/sqlrelay/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/Extensions/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: trunk/gnue-common/src/datasources/drivers/sybase/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/Schema/Creation/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/Schema/Discovery/Introspection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/Schema/Discovery/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/Schema/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/Connection.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/DataObject.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/Info.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/RecordSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/ResultSet.py
___________________________________________________________________
Name: svn:keywords
   + Id


Property changes on: 
trunk/gnue-common/src/datasources/drivers/sybase/sybase/__init__.py
___________________________________________________________________
Name: svn:keywords
   + Id





reply via email to

[Prev in Thread] Current Thread [Next in Thread]