[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7349 - in trunk/gnue-common/src/datasources/drivers: DBSIG2 adod
From: |
reinhard |
Subject: |
[gnue] r7349 - in trunk/gnue-common/src/datasources/drivers: DBSIG2 adodbapi/Schema/Discovery interbase/interbase mysql/mysql oracle/Schema/Discovery |
Date: |
Tue, 12 Apr 2005 04:24:48 -0500 (CDT) |
Author: reinhard
Date: 2005-04-12 04:24:47 -0500 (Tue, 12 Apr 2005)
New Revision: 7349
Modified:
trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
Log:
Removed "native" from Connection's public interface.
Modified: trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
2005-04-12 09:22:53 UTC (rev 7348)
+++ trunk/gnue-common/src/datasources/drivers/DBSIG2/Connection.py
2005-04-12 09:24:47 UTC (rev 7349)
@@ -89,8 +89,7 @@
else
self._encoding = 'utf-8'
- # FIXME: Should be private
- self.native = None
+ self._native = None
# ---------------------------------------------------------------------------
@@ -256,7 +255,7 @@
gDebug (3, "DBSIG2 Parameters: %s" % p)
# Create DBSIG2 cursor and execute statement
- cursor = self.native.cursor ()
+ cursor = self._native.cursor ()
try:
if p is not None:
cursor.execute (s, p)
@@ -410,7 +409,7 @@
(params, kwargs) = self._getConnectParams (connectData)
gDebug (3, 'DBSIG2 Connect')
try:
- self.native = self._driver.connect (*params, **kwargs)
+ self._native = self._driver.connect (*params, **kwargs)
except self._driver.DatabaseError:
raise Exceptions.LoginError, errors.getException () [2]
@@ -474,7 +473,7 @@
def _commit (self):
gDebug (3, 'DBSIG2 Commit')
try:
- self.native.commit ()
+ self._native.commit ()
except self._driver.DatabaseError:
raise Exceptions.ConnectionError, errors.getException () [2]
@@ -482,15 +481,12 @@
def _rollback (self):
gDebug (3, 'DBSIG2 Rollback')
- try:
- self.native.rollback ()
- except:
- pass # I'm SURE this isn't right (jcater)
- # But not all db's support transactions
+ if hasattr (self._native, 'rollback'):
+ self._native.rollback ()
# ---------------------------------------------------------------------------
def _close (self):
gDebug (3, 'DBSIG2 Close')
- if self.native:
- self.native.close ()
+ if self._native:
+ self._native.close ()
Modified:
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
===================================================================
---
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
2005-04-12 09:22:53 UTC (rev 7348)
+++
trunk/gnue-common/src/datasources/drivers/adodbapi/Schema/Discovery/Introspection.py
2005-04-12 09:24:47 UTC (rev 7349)
@@ -86,7 +86,7 @@
# Return a list of Schema objects
def getSchemaList(self, type=None):
QueryType = adSchemaTables
- rs = self._connection.native.adoConn.OpenSchema(QueryType)
+ rs = self._connection._native.adoConn.OpenSchema(QueryType)
rs.MoveFirst()
tables = []
@@ -123,8 +123,7 @@
def __getFieldSchema(self, parent):
statement = "select * from %s where 0=1" % (parent.name)
- cursor = self._connection.native.cursor()
- cursor.execute(statement)
+ cursor = self._connection.makecursor(statement)
list = []
Modified:
trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
2005-04-12 09:22:53 UTC (rev 7348)
+++ trunk/gnue-common/src/datasources/drivers/interbase/interbase/Connection.py
2005-04-12 09:24:47 UTC (rev 7349)
@@ -97,7 +97,7 @@
# ---------------------------------------------------------------------------
def _beginTransaction (self):
- self.native.begin ()
+ self._native.begin ()
# ---------------------------------------------------------------------------
Modified: trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
2005-04-12 09:22:53 UTC (rev 7348)
+++ trunk/gnue-common/src/datasources/drivers/mysql/mysql/Connection.py
2005-04-12 09:24:47 UTC (rev 7349)
@@ -77,7 +77,7 @@
def _beginTransaction (self):
# only available if MySQL is compiled with transaction support
try:
- self.native.begin ()
+ self._native.begin ()
except:
pass
Modified:
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
===================================================================
---
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
2005-04-12 09:22:53 UTC (rev 7348)
+++
trunk/gnue-common/src/datasources/drivers/oracle/Schema/Discovery/Introspection.py
2005-04-12 09:24:47 UTC (rev 7349)
@@ -84,11 +84,8 @@
% (string.join(where_type,"','"), where_user) + \
" order by table_name "
- GDebug.printMesg(3,statement)
+ cursor = self._connection.makecursor(statement)
- cursor = self._connection.native.cursor()
- cursor.execute(statement)
-
list = []
for rs in cursor.fetchall():
list.append(GIntrospection.Schema(attrs={'id':rs[0],
'name':string.lower(rs[1]),
@@ -114,11 +111,8 @@
" from all_catalog where %s " \
% (where)
- GDebug.printMesg(3,statement)
+ cursor = self._connection.makecursor(statement)
- cursor = self._connection.native.cursor()
- cursor.execute(statement)
-
list = []
rs = cursor.fetchone()
if rs:
@@ -137,21 +131,18 @@
owner, name, type = string.split(parent.id,'.')
- cursor = self._connection.native.cursor()
-
if type == 'SYNONYM':
statement = "select table_owner, table_name, " + \
"decode(db_link,null,'','@'||db_link) name " + \
"from all_synonyms " + \
"where owner = '%s' and synonym_name='%s'" % (owner, name)
- GDebug.printMesg(3,statement)
-
- cursor.execute(statement)
+ cursor = self._connection.makecursor(statement)
rs = cursor.fetchone()
owner, name, link = rs
if link is None:
link = ""
+ cursor.close()
else:
link = ""
@@ -162,10 +153,8 @@
"where owner = '%s' and table_name = '%s' " % (owner, name) + \
"order by column_id"
- GDebug.printMesg(3,statement)
+ cursor = self._connection.makecursor(statement)
- cursor.execute(statement)
-
list = []
for rs in cursor.fetchall():
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7349 - in trunk/gnue-common/src/datasources/drivers: DBSIG2 adodbapi/Schema/Discovery interbase/interbase mysql/mysql oracle/Schema/Discovery,
reinhard <=