Update of /cvsroot/modeling/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer
In directory sc8-pr-cvs1:/tmp/cvs-serv30704/Modeling/DatabaseAdaptors/OracleAdaptorLayer
Added Files:
oracle_utils.py __init__.py
Log Message:
Added OracleAdaptorLayer
--- NEW FILE: oracle_utils.py ---
#-----------------------------------------------------------------------------
#
# Modeling Framework: an Object-Relational Bridge for python
# (c) 2001, 2002, 2003 Sebastien Bigaret
#
# This file is part of the Modeling Framework.
#
# The Modeling Framework 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 of the License, or (at
# your option) any later version.
#
# The Modeling Framework 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 License along
# with the Modeling Framework; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-----------------------------------------------------------------------------
"""
Oracle Adaptor Layer's utils
Central point for determining Oracle specifics, like the version of the
oracle server in use.
CVS information
$Id: oracle_utils.py,v 1.1 2003/08/19 22:03:34 sbigaret Exp $
"""
__version__='$Revision: 1.1 $'[11:-2]
import os
def oracle_server_version():
"""
Returns the version of the oracle server currently in use. It currently
checks the environmement variable 'MDL_ORACLE_SERVER_VERSION'.
Return value:
- if MDL_ORACLE_SERVER_VERSION is not set, defaults to '8i'
- if it is set and equals to '9i', returns '9i', otherwise return the
default value '8i'
"""
pgversion=os.environ.get('MDL_ORACLE_SERVER_VERSION','').strip()
if pgversion=='9i':
return pgversion
else:
return '8i'
--- NEW FILE: __init__.py ---
#-----------------------------------------------------------------------------
#
# Modeling Framework: an Object-Relational Bridge for python
# (c) 2001, 2002, 2003 Sebastien Bigaret
#
# This file is part of the Modeling Framework.
#
# The Modeling Framework 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 of the License, or (at
# your option) any later version.
#
# The Modeling Framework 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 License along
# with the Modeling Framework; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-----------------------------------------------------------------------------
"""
This package is the db-adaptor for Oracle databases. It currently uses the
python DB-API v2.0 adaptor DCOracle2 (http://www.zope.org/Members/matt/dco2)
Model & Connection Dictionaries:
'adaptorName' -- should be 'Oracle'
'database' -- the global database name
'user', 'password' -- user and password
'host' -- ignored
Supported datatypes are:
char, varchar, varchar2, nchar, nvarchar2
number, decimal, int, integer, smallint, float, numeric, real,
date, time
with the additional datatypes for 9i:
timestamp, timestamp with time zone, timestamp with local time zone
"""
def adaptorFactory():
from OracleAdaptor import OracleAdaptor
return OracleAdaptor
|