示例#1
0
	def __init__(self):
		dBackend.__init__(self)
		self.dbModuleName = "kinterbasdb"
		self.fieldPat = re.compile("([A-Za-z_][A-Za-z0-9-_$]+)\.([A-Za-z_][A-Za-z0-9-_$]+)")
		self.paramPlaceholder = "?"
		import kinterbasdb
		initialized = getattr(kinterbasdb, "initialized", None)
		if not initialized:
			if initialized is None:
				# type_conv=200 KeyError with the older versions. User will need
				# mxDateTime installed as well:
				kinterbasdb.init()
			else:
				# Use Python's Decimal and datetime types:
				if kinterbasdb.__version__[0] == 3 and kinterbasdb.__version__[1] >= 3:
					# use type_conv=300 for blob encoding
					kinterbasdb.init(type_conv=300)
					dabo.dbActivityLog.info("kinterbasdb.init(type_conv=300)")
				else:
					kinterbasdb.init(type_conv=200)
					dabo.dbActivityLog.info("kinterbasdb.init(type_conv=200)")
			if initialized is None:
				# Older versions of kinterbasedb didn't have this attribute, so we write
				# it ourselves:
				kinterbasdb.initialized = True

		self.dbapi = kinterbasdb
示例#2
0
文件: dbFirebird.py 项目: xfxf/dabo
    def __init__(self):
        dBackend.__init__(self)
        self.dbModuleName = "kinterbasdb"
        self.fieldPat = re.compile(
            "([A-Za-z_][A-Za-z0-9-_$]+)\.([A-Za-z_][A-Za-z0-9-_$]+)")
        self.paramPlaceholder = "?"
        import kinterbasdb
        initialized = getattr(kinterbasdb, "initialized", None)
        if not initialized:
            if initialized is None:
                # type_conv=200 KeyError with the older versions. User will need
                # mxDateTime installed as well:
                kinterbasdb.init()
            else:
                # Use Python's Decimal and datetime types:
                if kinterbasdb.__version__[
                        0] == 3 and kinterbasdb.__version__[1] >= 3:
                    # use type_conv=300 for blob encoding
                    kinterbasdb.init(type_conv=300)
                    dabo.dbActivityLog.info("kinterbasdb.init(type_conv=300)")
                else:
                    kinterbasdb.init(type_conv=200)
                    dabo.dbActivityLog.info("kinterbasdb.init(type_conv=200)")
            if initialized is None:
                # Older versions of kinterbasedb didn't have this attribute, so we write
                # it ourselves:
                kinterbasdb.initialized = True

        self.dbapi = kinterbasdb
示例#3
0
	def __init__(self):
		dBackend.__init__(self)
		self.dbModuleName = "pysqlite2"
		self.paramPlaceholder = "?"
		try:
			from pysqlite2 import dbapi2 as dbapi
		except ImportError:
			import sqlite3 as dbapi
		self.dbapi = dbapi
示例#4
0
文件: dbMsSQL.py 项目: xfxf/dabo
	def __init__(self):
		dBackend.__init__(self)
		#- jfcs 11/06/06 first try getting Microsoft SQL 2000 server working
		# MSSQL requires the installation of FreeTDS.  FreeTDS can be downloaded from
		# http://www.freetds.org/
		self.dbModuleName = "pymssql"
		self.useTransactions = True  # this does not appear to be required
		import pymssql
		self.dbapi = pymssql
示例#5
0
文件: dbSQLite.py 项目: xfxf/dabo
 def __init__(self):
     dBackend.__init__(self)
     self.dbModuleName = "pysqlite2"
     self.paramPlaceholder = "?"
     try:
         from pysqlite2 import dbapi2 as dbapi
     except ImportError:
         import sqlite3 as dbapi
     self.dbapi = dbapi
示例#6
0
文件: dbMsSQL.py 项目: moscati/dabo
    def __init__(self):
        dBackend.__init__(self)
        # - jfcs 11/06/06 first try getting Microsoft SQL 2000 server working
        # MSSQL requires the installation of FreeTDS.  FreeTDS can be downloaded from
        # http://www.freetds.org/
        self.dbModuleName = "pymssql"
        self.useTransactions = True  # this does not appear to be required
        import pymssql

        self.dbapi = pymssql
示例#7
0
文件: dbOracle.py 项目: xfxf/dabo
 def __init__(self):
     import cx_Oracle as dbapi
     dBackend.__init__(self)
     self.dbModuleName = "cx_Oracle"
     self.dbapi = dbapi
示例#8
0
	def __init__(self):
		dBackend.__init__(self)
		#### TODO: Customize with name of dbapi module
		self.dbModuleName = "???"
示例#9
0
	def __init__(self):
		import cx_Oracle as dbapi
		dBackend.__init__(self)
		self.dbModuleName = "cx_Oracle"
		self.dbapi = dbapi
示例#10
0
文件: dbPostgreSQL.py 项目: xfxf/dabo
 def __init__(self):
     """JFCS 08/23/07 Currently supporting only psycopg2"""
     dBackend.__init__(self)
     self.dbModuleName = "psycopg"
     self.conn_user = ""
示例#11
0
文件: dbTemplate.py 项目: xfxf/dabo
 def __init__(self):
     dBackend.__init__(self)
     #### TODO: Customize with name of dbapi module
     self.dbModuleName = "???"
示例#12
0
	def __init__(self):
		"""JFCS 08/23/07 Currently supporting only psycopg2"""
		dBackend.__init__(self)
		self.dbModuleName = "psycopg"
		self.conn_user = ""
示例#13
0
	def __init__(self):
		dBackend.__init__(self)
		self.dbModuleName = "MySQLdb"
示例#14
0
 def __init__(self):
     dBackend.__init__(self)
     self.dbModuleName = "MySQLdb"