Http://blog.csdn.net/wanglihuahaiyan/article/details/4381417
--------------------------------------------------
DotConnect
Oracle is a. net platform developed by Devart to access Oracle databases. Its Professional Edition is a paid version that provides features not available for many other drivers
Features, such
Oracle Support. We generally do not buy it for development, and it is not suitable to use its cracked version in actual projects. Here we use its Express free version, which provides
The features are basically the same as those provided by Microsoft and Oracle. This version can be downloaded from the following link.
Http://www.devart.com/dotconnect/oracle/dcoraclefree.exe
I want to use this free version for the following reasons:
1. Microsoft will not provide their Oracle drivers in the latest. Net Framework (4.0. I liked the Oracle driver provided by other vendors.
2.
Using the driver provided by Microsoft has an almost unsolved problem, that is, OCI-22053 overflow error. Oracle
The numeric data type can store up to 38 bytes of precision. When the Oracle value is converted to the Data Type of the Common Language Runtime database, the Oracle value may become too large. This causes
Oracle OCI-22053
Overflow error. This problem is often encountered when we obtain the values calculated using SQL functions such as avg. The solution is to truncate the numeric value in the SQL statement or convert the numeric value into a string. However
This is a bit uncomfortable. Devart dotConnect For Oracle does not have this problem.
3. dotConnect For Oracle supports a variety of Oracle Database encodings.
4. dotConnect For Oracle can access the Oracle database service on a machine without an Oracle Client installed.
5. performance considerations. According to the data provided by Devart, the performance of dotConnect For Oracle is better than that of the drivers provided by Microsoft and Oracle. Specific can refer to the http://www.devart.com/dotconnect/oracle/performance.html.
Nhibconnect is an open-source ORM framework that is unlikely to be directly supported by commercial Devart dotConnect For Oracle. However, we can extend nhibart to support the Devart driver.
Create a new class library (ClassLibrary) project named nhib.pdf. DevartOracle. The generated Dll name and default namespace are
Nhib.pdf. DevartOracle. Add reference to the dll related to nhib.pdf. The reference class library and file structure of the project are shown in. Used here
Nhib.pdf is the latest version 2.1.0GA.
Create an OracleClientDriver inherited by the DevartOracleDriver class. In this class, NHibernate can be generated.
Use Devart dotConnect For IDbConnection and IDbCommand
Oracle implementation. The ReflectionBasedDriver class inherited by DevartOracleDriver can also implement the same function. But I think
OracleClientDriver class inheritance is more efficient at runtime, and DevartOracleDriver class compilation is simpler.
If the DevartOracleDriver class is used in the connection. driver_class configuration of nhib.pdf. We found that
An error is reported in the GetReservedWords method of the OracleDataBaseSchema class. This shows that Devart
DotConnect
Some implementations in Oracle are still a little different from those in System. Data. OracleClient and volume El. DataAccess. Fortunately
The GetReservedWords method in the OracleDataBaseSchema class can be overwritten. We can create a new
Subclass of the OracleDataBaseSchema class. Override the GetReservedWords method. We name the new subclass
DevartOracleDataBaseSchema.
To use our own DevartOracleDataBaseSchema, you must override
Oracle8iDialect, Oracle9iDialect, And the GetDataBaseSchema method in Oracle10gDialect class. Me
Name the three sub-classes
DevartOracle8iDialect, DevartOracle9iDialect, DevartOracle10gDialect. In practical application
The preceding three Dialect options can be selected based on the Oracle database type.
In the nhibect configuration, we can use our own Dialect and Driver as follows.
To
Now we can use nhib.pdf. DevartOracle. dll to conveniently use Devart dotConnect
As the driver for accessing the Oracle database, Oracle enjoys its outstanding features. Thanks to the scalability and customization of the nhib.pdf framework. This is actually an excellent
Basic requirements of the show framework.