Опит в използването на ODP.NET с Oracle 9i

Slides:



Advertisements
Similar presentations
Getting Started with Oracle and .NET
Advertisements

17. Data Access ADO.Net Architecture New Features of ADO.NET
ADO vs ADO.NET ADOADO.NET Client/server coupledDisconnected collection of data from data server Uses RECORDSET object (contains one table) Uses DATASET.
ODP.NET.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Objective In this session we will discuss about : What is ADO. NET ?
Getting Started with Oracle and.NET Christian Shay Principal Product Manager,.NET and Windows Oracle USA.
1. Getting Started with Oracle and.NET Riaz Ahmed Director Software Development at Oracle.
Bruce Armstrong TeamSybase
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
DEV 301 Oracle Developer Tools for Visual Studio.NET Christian Shay, Oracle Corporation Alex Keh, Oracle Corporation.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
1 ODBC, OLE DB, ADO, and ASP. 2 Introduction  Because database applications today reside in a complicated environment, various standards have been developed.
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Developing Web Applications Using Microsoft ® Visual Studio ® 2008.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Module 7: Accessing Data by Using ADO.NET
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
An Introduction to ADO.Net Marmagna Desai.NET Seminar, Fall-2003.
School of Computing and Management Sciences © Sheffield Hallam University Issues of Data Access 101(-ish) ways to access data from a database! ODBC One.
ADO.NET connections1 Connecting to SQL Server and Oracle.
What is a Package? A package is an Oracle object, which holds other objects within it. Objects commonly held within a package are procedures, functions,
HNDIT Rapid Application Development
Basics of JDBC Session 14.
Module 4 Introduction ADO.NET.
Introduction Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers.
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Alex Keh Principal Product Manager Windows Development Oracle Corporation.
Oracle Opens Your Windows Dick Vesters Frank van der Borden Oracle Nederland BV.
Data Access. ADO.NET ADO.NET is the primary library for building database solutions within the.NET Framework. ADO.NET does not replace ADO. ADO and OLEDB.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
Integrating Data Lesson 6.
ASP.NET Programming with C# and SQL Server First Edition
Data Access with ADO.NET
Introduction to ADO.NET
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
ODBC, OCCI and JDBC overview
ADO.NET Framework.
Programming the Web Using ASP.Net
Lecture 6 VB.Net SQL Server.
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Active Data Objects Binding ASP.NET Controls to Data
ADO.NET Accessing Databases in VS.NET
DATABASE MANAGEMENT SYSTEM
Tonga Institute of Higher Education
Database Objects 1/12/2019 See scm-intranet.
Chapter 10 ADO.
Database Applications
Chapter 8 Advanced SQL.
MATERI PL/SQL Procedures Functions Packages Database Triggers
.NET Framework Data Providers
Active Data Objects Binding ASP.NET Controls to Data
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
Introduction to Database Programming through ADO. NET
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Опит в използването на ODP.NET с Oracle 9i Лектор: Иван Симеонов ТехноЛогика ЕООД

Какво е Oracle Data Provider for .NET (ODP.NET) ASP.NET VB.NET C# C++.NET OLE DB .NET ODBC .NET ODP .NET ORACLE OLE DB ORACLE ODBC The introduction of the Microsoft .NET Framework has produced a new Windows application server environment different from COM. With COM, data can be accessed from an Oracle database through either Oracle Objects for OLE (OO4O), ADO/OLE DB, or ODBC. In a .NET environment, users still can access the Oracle database via OLE DB and ODBC using a data access bridge provided by Microsoft. For OLE DB, this bridge is OLE DB .NET; For ODBC, the bridge is ODBC .NET. These bridges provide interoperability between the managed .NET layer and unmanaged COM or Win32 layer. The Oracle Data Provider for .NET (ODP.NET) represents the third method for accessing the Oracle database. DIFFERENCES WITH OTHER .NET DATA PROVIDERS Among the three data access methods, ODP.NET is the most native to the .NET environment, bypassing the need for OLE DB or ODBC. It features high performance access to the Oracle database, while providing access to advanced Oracle functionality not available through OLE DB .NET and ODBC .NET. Similar to OLE DB .NET and ODBC .NET, ODP.NET can be used from any .NET language, such as C# and Visual Basic .NET. An important distinction is that ODP.NET does not use an extra data access bridge; thus, it will have better performance than OLE DB .NET and ODBC .NET. Additionally, because these .NET bridges are built for generic data sources, they do not provide full access to advanced database functionality. These three .NET data providers are shown in Figure.   ORACLE DB

ODP.NET Обектен модел Disconnected Layer Connected Layer (ODP.NET) Data Layer Oracle DataAdapter OracleCommand Builder DataSet Oracle DataReader Oracle Command Business Object Oracle Transaction Oracle Connection Oracle

Основни характеристики на ODP.NET Full PL/SQL support Packaged, non-packaged, anonymous, autonomous Batch SQL available with anonymous PL/SQL Native Oracle data types LOBs, REF Cursor, Date, TimeStamps, Long, Raw, etc. Connection pooling Min, Max, Timeout, Lifetime, Increment, Decrement Transactions Enterprise Services via Oracle Services for MTS Savepoints Globalization Full Unicode support Client settings are used to display Oracle data in locale-specific manner Transparent application failover Notification callbacks Here are some of the ODP.NET features that were not previously available to ADO, OLE DB .NET, nor ODBC .NET users: More robust anonymous (use PL/SQL blocks in .NET code) PL/SQL support Native Oracle types and safe type mapping Connection Pooling Configuration PL/SQL can be used more flexibly with ODP.NET. Anonymous PL/SQL allows the client to batch SQL calls to the DB. When you embed multiple commands within anonymous PL/SQL, only one roundtrip to the database is made, thereby improving data access performance. Native Oracle types allow users to use Oracle data types within their .NET programs. This makes using Oracle data easier and much more flexible from .NET. It saves developers and applications from doing unnecessary conversions to .NET data types if they are not needed. Each native Oracle data type can be mapped to a respective .NET data type. Because Oracle data types tend to be higher precision than .NET types, Oracle allows conversion between the two types without losing data. This is known as safe type mapping. For example, Oracle Number can hold 38 digits, whereas .NET Decimal only holds 28. Safe type mapping allows converting Oracle Number to .NET byte array or .NET string and back to Oracle Number without losing any data. Creating DB connections is resource intensive. As such, connection pooling is an invaluable performance tuning option. Previously, .NET developers could only set timeout values for their connection pools. With ODP.NET, connection pools are very flexible to configure for any type of application user load.

Основни характеристики на ODP.NET - продължение Parameters PL/SQL Associative Array data type Parameter Array binding Named and positional parameters XML DB XML repository Native XMLType XML stored as CLOB or object Schema and non-schema-based XML Views PL/SQL Associative Array Parameter Array Binding Named parameter binding and array binding The associative array, also known as index-by table, is a PL/SQL data type similar to a hash table. It can be bound as an ODP.NET parameter and passed as an array to .NET. Parameters can be bound to PL/SQL or SQL calls either through using named parameters or by sequential position. Array binding improves application performance by reducing the number of roundtrips for DML primarily. For example, without array binding, updating 100 rows would require 100 DB server roundtrips. With array binding, only one roundtrip is necessary to do all 100 updates. This makes applications perform considerably faster. ODP.NET has the flexibility to bind parameters by position or name, whichever best fits the developer’s preference. DataAdapter Requery allows developers to reuse the same query result for multiple data fills of DataSet. This feature saves applications from having to re-query the DB for the same set of data. XML DB is a high performance XML storage and retrieval technology in the Oracle DB. XML DB stores XML natively in the DB with its own data type, XMLType. ODP.NET exposes XMLType as a native type within .NET to manipulate XML and share XML with Microsoft’s XML services, such as XMLReader. ODP.NET can access relational and object-relational data as XML with the ability to query and save XML from the database easily.

Oсновни предимства на ODP.NET Multiple Active Result Sets (MARS) Native XML Data Type Result Set Retrieval Tuning Options Configurable LOB Retrieval Array Parameters

Oracle Helper ExecuteDataSet – 6 overloads ExecuteFunction – 9 overloads ExecuteReader – 6 overloads ExecuteScalar – 6 overloads ExecuteNonQuery – 6 overloads ExecuteXMLReader – 6 overloads

Проблеми с ODP.NET Липсва DeriveParameters за PL/SQL процедури PLSQL Associative Arrays без стойност на елемент Не поддържа varray като параметър ExecuteScalar не работи с PL/SQL Functions без RefCursor Разлика в типовете данни

Добри практики при използването на ODP.NET Използвайте connection pooling Отстранявайте ODP.NET обектите, когато приключите работа Минимизирайте roundtrips Оптимизиране на single statement (SELECT) Използвайте FetchSize (OracleDataReader) и RowSize (OracleCommand) Използвайте DataAdapter.Requery Намалява roundtrips при повторно изпълнение на команда

Добри практики при използването на ODP.NET - продължение Оптимизиране на multi-statement Изпълнявате много и различни команди? Използвайте anonymous PL/SQL Използвайте групови команди Изпълнявате една команда много пъти? Използвайте parameter array binding Използвайте PL/SQL associative arrays

Добри практики при използването на ODP.NET - продължение Използвайте OracleRefCursor class Данните се извличат, когато е необходимо Използвайте Oracle LOB classes (DML) Няма необходимост да изтегляте данните за да променяте или добавяте LOBs Желаете данните в LOB на един път? Използвайте InitialLOBFetchSize, за да оптимизирате извличането на LOB Желаете да извлечете LOB по-късно? По подразбиране, ODP.NET използва LOB locators

Добри практики при използването на ODP.NET - продължение Използвайте PL/SQL пакети Управлявайте транзакциите от .NET Когато е възможно, използвайте multiple RefCursors Използвайте собствен error handling (Exceptions.ApplicationBlock) …

Други .NET Providers за Oracle Microsoft .NET Data Provider for Oracle Corelab OraDirect .NET Data Provider DataDirect Connect for .NET

Кой .NET Provider да използваме За малки приложения и бърза разработка – MS Data Provider for Oracle За пълно използване на възможностите на Oracle DB и висока производителност – ODP.NET http://msdn.microsoft.com/data/default.aspx?pull=/library/en-us/dnadonet/html/ODPvsMSDP.asp