Date post: | 15-Dec-2015 |
Category: |
Documents |
Upload: | joel-penner |
View: | 218 times |
Download: | 0 times |
IBM Corporation 2003 Kansas City Informix User's Group
Agenda
• Overview of .NET
• .NET Framework Architecture
• ADO.NET Architecture
• Features of the IDS .NET Provider
• Roadmap of IDS .NET Support
IBM Corporation 2003 Kansas City Informix User's Group
Overview of .NET
• .NET is a new framework for developing enterprise applications– Actively in use on Microsoft Windows platforms– No single language required for development
• .NET is a response to industry trends:– Distributed Computing– Componentization– Enterprise Services – Web paradigm shifts– Maturity
IBM Corporation 2003 Kansas City Informix User's Group
Overview of .NET
• Requires a new API (provider) for access to data sources– API is exposed as a set of .NET interfaces
• Object-Oriented Architecture
• “Namespaces” used to organize classes into related groups
• Managed vs. Unmanaged code
IBM Corporation 2003 Kansas City Informix User's Group
.NET Framework Architecture
Web Services ASP.NET Win Forms
ADO.NET / XML Classes
Framework Base Classes
CLR
VS.
N
E
T
IBM Corporation 2003 Kansas City Informix User's Group
.NET Framework Architecture• Common Language Runtime (CLR)
– runtime environment that manages memory, garbage collection, code access security
– managed code
• Framework Base Classes– provide I/O, collections, and threading functionality
• ADO.NET– provides data access API
• ASP.NET, Web Services & Forms– focuses on specific aspects of application development
IBM Corporation 2003 Kansas City Informix User's Group
ADO .NET Architecture
• .NET framework’s data management capabilities are encapsulated into a single component : ADO.NET
• ADO.NET contains:– Data Provider API which interacts with the
actual data source– Content class, DataSet, which provides
application program level abstraction for the data to/from the data source
IBM Corporation 2003 Kansas City Informix User's Group
What is a .NET Provider?• Runtime class library that encapsulates a
data access API for use by Microsoft .NET applications
• Set of specialized classes that implement standard ADO.NET interfaces and serve as a bridge between a data source and .NET applications
IBM Corporation 2003 Kansas City Informix User's Group
ADO .NET Architecture
Clie
nt
Ap
plic
atio
n
DataRelation
DataSet
DataTable
DataColumn DataColumn DataColumn DataColumn
DataReader DataAdapter
Command
Transaction
Connection
.NET Provider Classes
IBM Corporation 2003 Kansas City Informix User's Group
ADO .NET Architecture
• System.Data namespace – Microsoft class library for general data access functionality
• Default “bridge” providers for use with System.Data class and either an OLEDB provider or an ODBC driver– Provide IDS connectivity via Informix OLEDB or
ODBC driver
• IBM.Data.Informix – Informix namespace which defines a class library implementing .NET interfaces for IBM Informix data access
IBM Corporation 2003 Kansas City Informix User's Group
ADO .NET Data Retrieval
• Two Models– Connected
• similar to typical client/server model• obtains and maintains a connection with which to work
– Disconnected• by default, data is disconnected in .NET• DataSet supports this model by presenting an in-memory view
of a data source• after data is retrieved, connection can be discarded• changes performed on DataSet can be applied to the database
with a new connection
IBM Corporation 2003 Kansas City Informix User's Group
Classes defined by the IDS .NET Provider
• IfxConnection – manages a connection to an Informix database
• IfxTransaction – represents a database transaction• IfxCommand – manages execution of SQL commands• IfxCommandBuilder – automatically generates
commands, given a SELECT statement• IfxParameter – represents a parameter to a Command
object• IfxParameterCollection – represents a collection of all
parameters relevant to a Command object
IBM Corporation 2003 Kansas City Informix User's Group
Classes defined by the IDS .NET Provider
• IfxDataReader – provides forward-only, read-only access to data
• IfxDataAdapter– boundary between .NET provider and non-provider
content classes
– builds the DataSet objects (DataTable, DataColumn, DataRow etc), given a query and a DataSet instance
• IfxError, IfxException, IfxErrorCollection - for error and exception processing
IBM Corporation 2003 Kansas City Informix User's Group
IfxConnection Details
• Can be established:– programmatically using ConnectionString
property of IfxConnection class– user environment – using SetNet to update the system registry
database
• Order of precedence is ConnectionString, user environment, and then SetNet
IBM Corporation 2003 Kansas City Informix User's Group
Connection Attributes
• User and Password• INFORMIXSERVER• Database Name• Service• CLIENT_LOCALE• DB_LOCALE• Fetch Buffer Size • Enlist (in a distributed
transaction)
• Connection Pooling• Connection Time Out• Connection Lifetime• Minimum Pool Size• Maximum Pool Size • Persist Security Info
IBM Corporation 2003 Kansas City Informix User's Group
Data Types in the IDS .Net ProviderInformix Database Type .Net Framework Type .Net Typed Accessor Informix Typed
Accessorboolean Boolean GetBoolean()
sm allint Int16 GetInt16()
integer Int32 GetInt32()
serial Int32 GetInt32()
int8 Int64 GetInt64()
serial8 Int64 GetInt64()
decim al (p<=28), fixed scale Decim al GetDecim al () GetIfxDecim al()
decim al (p<=28), floating point
Double GetDouble() GetIfxDecim al ()
decim al (p>28) String GetString() GetIfxDecim al()
m oney sam e as decim al with sam e precis ion
sam e as decim al with sam e precis ion
GetIfxMoney ()
sm allfloat, real Float GetFloat()
float, double Double GetDouble()
date DateTim e GetDateTim e()
datetim e DateTim e GetDateTim e() GetIfxDateTim e()
interval, year-m onth String GetString() GetIfxMonthSpan()
Interval, day-fraction Tim eSpan GetTim eSpan () GetIfxTim eSpan()
char(1) Char GetChar() GetChars()
char String GetString() GetChars()
lvarchar String GetString() GetChars()
IBM Corporation 2003 Kansas City Informix User's Group
Data Types in the IDS .Net ProviderInformix Database Type .Net Framework Type .Net Typed Accessor Informix Typed Accessornchar String GetString() GetChars ()
varchar String GetString() GetChars ()
byte Byte[] GetBytes()
text String GetString() GetChars ()
blob Byte[] GetBytes() GetIfxBlob()
clob String GetString() GetChars () GetIfxClob()
lis t String GetString() GetIfxLis t()
m ultiset String GetString() GetIfxMultiset()
set String GetString() GetIfxSet()
nam ed row type String GetString() GetIfxRow()
unnam ed row type String GetString()
dis tinct As the underlying type As the underlying type
IBM Corporation 2003 Kansas City Informix User's Group
Classes for Informix Data Types
• IfxDecimal • IfxDateTime • IfxTimeSpan • IfxMonthSpan • IfxRow • IfxComplexLiteral • IfxBlob • IfxClob
IBM Corporation 2003 Kansas City Informix User's Group
Using MTS with the IDS .Net Provider
• Using CLR to implement COM+ configured classes is easier than implementing them with COM
• System.EnterpriseServices Namespace – provides the .NET classes, interfaces, structures,
delegates, and enumerations with access to COM+ services
• ServicedComponent Class– base class for all COM+ services
• ContextUtil Class – wraps the CoGetObjectContext, the COM+ API for
retrieving object context
IBM Corporation 2003 Kansas City Informix User's Group
Using MTS with the IDS .Net Provider
• Connection can be enlisted in distributed transaction – manually
• Set IfxConnection class Enlist property to false• Application calls EnlistDistributedTransaction() method to enlist into
the distributed transaction
– automatically • Set IfxConnection class Enlist property to true• Application sets TransactionOption attribute to Required or RequiresNew
• MS DTC is still unmanaged code– New “plumbing” minimizes some data type conversions– Explicit resource deallocation may be required
IBM Corporation 2003 Kansas City Informix User's Group
API Tracing with the IDS .Net Provider
• IFXDOTNETTRACE – sets the level of tracing to be reported– Trace levels
• 0 = no tracing
• 1 = reports API calls entry & exit
• 2 = level 1 + function parameter values
• IFXDOTNETTRACEFILE- sets the log file where trace information is to be written
IBM Corporation 2003 Kansas City Informix User's Group
Integration with Microsoft Visual Studio.Net
• Emphasis on improving Visual Studio.NET development experience when using IBM (DB2 and IDS) DBMS
• IBM connections and database projects are depicted within Visual Studio:– Data Connections folder– Server Explorer tab– Solution Explorer shows IBM database projects
• Future release will add support for:– IDS SQL Editor– IDS Query Builder– Content and dynamic help
IBM Corporation 2003 Kansas City Informix User's Group
Installation and Deployment
• IDS .Net Provider requires .NET framework version 1.1
• IDS .Net Provider will be included with CSDK (development) and I-Connect (runtime) distributions
• Requires a stored procedure to be installed in sysmaster database of each server instance
IBM Corporation 2003 Kansas City Informix User's Group
Roadmap of IDS .NET Support
• IDS .NET Provider completed technology preview in Q4 ‘03
• IDS .NET Provider is currently available in the CSDK 2.81.TC3 release
• Subsequent releases of the provider will add additional functionality– Release mechanism will remain via CSDK and I-
Connect products
IBM Corporation 2003 Kansas City Informix User's Group
Where to Get More Information
• IBM developerWorks Informix zone page: (www7b.boulder.ibm.com/dmdd/zones/informix/)
• Microsoft .NET Framework home page: http://msdn.microsoft.com/netframework
• IBM Informix .NET Provider product documentation
• Contact us! – [email protected]– [email protected]