Integrating Web & DBMS



Similar documents
Visual Basic Database Programming

ASP.NET Programming with C# and SQL Server

Connecting to an Excel Workbook with ADO

Troubleshooting guide for errors in Active Server Pages and Microsoft Data Access Components

Classes para Manipulação de BDs 5

ODBC Client Driver Help Kepware, Inc.

Proficy* HMI/SCADA - ifix U SING SQL

Short notes on webpage programming languages

ODBC Chapter,First Edition

ACDS AIMS Certified Database Specialist Course.

Setting Up ALERE with Client/Server Data

ODBC Overview and Information

Accessing Database Information Using Visual Basic:

FileMaker 11. ODBC and JDBC Guide

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

2. Unzip the file using a program that supports long filenames, such as WinZip. Do not use DOS.

Introduction to ASP. Are you sick of static HTML pages? Do you want to create dynamic web pages? Do you

ProficyTM. HMI/SCADA - ifix U SING SQL

Chapter 4 Accessing Data

Database-driven library system

FileMaker 12. ODBC and JDBC Guide

Siemens Applied Automation Page 1 11/26/03 9:57 PM. Maxum ODBC 3.11

IENG2004 Industrial Database and Systems Design. Microsoft Access I. What is Microsoft Access? Architecture of Microsoft Access

Fasthosts ASP scripting examples Page 1 of 17

Database Connectivity Toolset User Manual

SalesLogix. SalesLogix v6 Architecture, Customization and Integration

Using the Query Analyzer

Book 3. Database Connectivity. U:\Book\Book_03.doc Database Connectivity

Jet Data Manager 2012 User Guide

Technical Bulletin 005 Revised 2010/12/10

BarTender s ActiveX Automation Interface. The World's Leading Software for Label, Barcode, RFID & Card Printing

SQL Server Training Course Content

Chapter 7 -- Adding Database Support

StreamServe Persuasion SP4

LabVIEWTM. Database Connectivity Toolkit User Manual. Database Connectivity Toolkit User Manual. June A-01

Perceptive Intelligent Capture Solution Configration Manager

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

Using LDAP Authentication in a PowerCenter Domain

DBISAM Version 4 ODBC Driver Manual

CHAPTER 1: CLIENT/SERVER INTEGRATED DEVELOPMENT ENVIRONMENT (C/SIDE)

Database Connectivity and Server-Side Scripting

Data Domain Profiling and Data Masking for Hadoop

A basic create statement for a simple student table would look like the following.

Create a New Database in Access 2010

BarTender Integration Methods. Integrating BarTender s Printing and Design Functionality with Your Custom Application WHITE PAPER

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

PaperClip Audit System Installation Guide

Benchmarks of SQL Query Performance for ODBC and Oracle Call Interface

Crystal Reports. Overview. Contents. Connecting the Report Designer Component to a Data Source

Migrating helpdesk to a new server

Advantage Database Server

FileMaker 13. ODBC and JDBC Guide

AWS Schema Conversion Tool. User Guide Version 1.0

Microsoft SQL Server Features that can be used with the IBM i

Web Application Disassembly with ODBC Error Messages By David Litchfield Director of Security

User's Guide. Using RFDBManager. For 433 MHz / 2.4 GHz RF. Version

CHAPTER 23: USING ODBC

ReportBy ODBC Connection setup

XMailer Reference Guide

UNISYS. Business Information Server. MRI Administration and User s Guide. Printed in USA May

Teradata SQL Assistant Version 13.0 (.Net) Enhancements and Differences. Mike Dempsey

MS-Access Database Programming

Programming Database lectures for mathema

AVALANCHE MC 5.3 AND DATABASE MANAGEMENT SYSTEMS

MySQL for Beginners Ed 3

VBA and Databases (see Chapter 14 )

Use the ADO Control in your Visual Basic 6 projects

Thank you for using AD Bulk Export 4!

Suite. How to Use GrandMaster Suite. Exporting with ODBC

SYSMAC SCS V2.2 DATABASE

SQL Injection. The ability to inject SQL commands into the database engine through an existing application

v4.8 Getting Started Guide: Using SpatialWare with MapInfo Professional for Microsoft SQL Server

Database migration using Wizard, Studio and Commander. Based on migration from Oracle to PostgreSQL (Greenplum)

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

"SQL Database Professional " module PRINTED MANUAL

2015, André Melancia (Andy.PT) 1

Using Temporary Tables to Improve Performance for SQL Data Services

KonyOne Server Installer - Linux Release Notes

I/A Series Information Suite AIM*DataLink

Basic SQL Server operations

FileMaker 14. ODBC and JDBC Guide

ADO and SQL Server Security

ODBC Driver Version 4 Manual

Connecting LISTSERV to an Existing Database Management System (DBMS)

Informatica Corporation Proactive Monitoring for PowerCenter Operations Version 3.0 Release Notes May 2014

SQL Direct User Guide

SQL Server Developer Training Program. Topics Covered

OBJECTSTUDIO. Database User's Guide P

Package sjdbc. R topics documented: February 20, 2015

Tech Note 663 HMI Reports: Creating Alarm Database (WWALMDB) Reports

Video Administration Backup and Restore Procedures

DataFlex Connectivity Kit For ODBC User's Guide. Version 2.2

StreamServe Persuasion SP5 Microsoft SQL Server

Transcription:

Integrating Web & DBMS Gianluca Ramunno < ramunno@polito.it > english version created by Marco D. Aime < m.aime@polito.it > Politecnico di Torino Dip. Automatica e Informatica Open Database Connectivity (ODBC) technology for DBMS access that is part of Microsoft Data Access Components (MDAC) C++ low level interface included in Microsoft O.S. allows accessing data from any application in DBMS-independent way inserts a middleware (the database driver) between application and DBMS uses SQL as data access & manipulation language used by DAO (application level interface) ODBC A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-1

Open Database Connectivity (ODBC) application driver manager driver driver driver data source data source data source SqlServer oracle xls ODBC Open Database Connectivity (ODBC) application driver manager (DLL) loads the drivers upon application request driver (DLL) executes the ODBC calls received by the Driver Manager the application sees the driver manager and the drivers as a single component data source DBMS, network, OS hosting the DBMS ODBC A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-2

Driver in single-tier configuration the same node hosts: application driver manager driver software for data access (data access software) data storage two possible configurations: stand alone network ODBC Driver in single-tier configuration stand-alone network ODBC A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-3

Driver in multiple-tier configuration the client node hosts: application driver manager driver the server node hosts: software for data access (data access software) data storage ODBC Driver in multiple-tier configuration ODBC A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-4

Driver multiple-tier with gateway features an additional gateway node forward the requests to the data access software ODBC technology (MDAC) included in Microsoft OSes evolution of ODBC COM (Component Object Model) interface to provide applications with uniform access to data from different sources relational DBMSes not relational DBMSes (new) file system, mail system, spreadsheets, directory, not limited to SQL C++ low level interface A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-5

consumer applications accessing data through the interface provider intermediary providing the data implements methods not all providers have the same capabilities; it depends on which methods they implement consumer application or tool interface ODBC File Native provider A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-6

application or tool interface OLE.ODBC interface ODBC Driver Manager ODBC Driver interface Text File interface database database ODBC provider simple provider native provider provider example Jet 4.0 is the Access engine native provider application proprietary interface Jet 4.0 database native provider A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-7

(ActiveX Data Object) middleware with object oriented interface evolution of DAO makes the interface accessible to other languages than C++ it is an application level wrapper for can be used with different languages by complied user programs (VisualBasic) macros inside applications like MS-Office (VisualBasic for Application - VBA) WSH: script console (Jscript, VBscript) ASP pages in IIS (Jscript, VBscript) application or tool interface OLE.ODBC interface ODBC driver manager ODBC driver inteface text file interface database database ODBC provider simple provider native provider A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-8

: object model Connection Recordset Fields Field Command Properties Parameters Property Parameter Properties Property Errors Error objects Connection object represents a connection to a specific data source Command object used to define a specific command, like a SQL query, to a data source Recordset object represents the set of records belonging to a whole table or resulting by a query composed by rows (record) and columns (field) A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-9

Record object represents a data row objects corresponds to a single record of a recordset Field object represents a data column corresponds to a column of a recordset Parameter object represents a parameter associated with command object (e.g. parameters for a stored procedure) objects & collections Error object details on an error occurred during a failed operation with the provider Fields collection contains all the Field objects of a recordset Errors collection contains all the Error objects generated during a failed operation with the provider Parameters collection contains all the Parameter objects of a command A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-10

Connection Provider Connection Open ConnectionString Execute Mode properties methods Close Connection Mode DB opening mode read-only is default for read-write con.mode = admodereadwrite Execute (stringsql) returns a read-only RS with forward-only cursor if other properties are needed, d use rs.open instead of con.execute A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-11

Recordset Open Close EOF Index proprietà p Recordset AddNew Delete MoveFirst MoveLast MoveNext MovePrevious Update metodi Recordset: open method opening a recordset ObjRS.Open O ( Source, ActiveConnection, CursorType, LockType, option ); Source: SQL command, table name, stored procedure ActiveConnection: an object of type Connection, or a connection string CursorType: type of cursor on the resulting RS Locktype: type of lock on data Option: interpretation for Source A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-12

adopenunspecified adopenforwardonly (default) adopenkeyset adopendynamic adopenstatic CursorType Unspecified type of cursor. This improves performance when only one pass through a RS is needed. Like a dynamic cursor, except that you can't see records that other users add, although records that other users delete are inaccessible from your RS. Data changes by other users are still visible. Additions, changes, and deletions by other users are visible, ibl and all types of movement through the RS are allowed. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible. Recordset: AddNew method adding a record // if the table is not accessible... objrs.open("users", constring, adopendynamic, adlockpessimistic); // adding the record objrs.addnew(); objrs("name") = "Alberto"; objrs("surname") = "Rossi"; objrs.update(); A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-13

operation model (query) 1. create an connection object 2. open the connection towards a DBMS 3. create an recordset object 4. open the recordset 5. manipulate data inside the recorset 6. close the recordset 7. close the connection 8. remove the objects : ASP/JScript example (query) creating and opening the connection <% @LANGUAGE="JScript" %> <!--#include file="adojavas.inc"--> <% var con; var constring; con = Server.CreateObject("DB.Connection"); constring = "Provider=Microsoft.Jet.OLEDB.4.0; " + "Data Source= c:\\webdata\\mydb.mdb "; con.open(constring); %> A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-14

: ASP/JScript example (query) creating and opening the recordset <% var rst; var ssqlstring; rst = Server.CreateObject("DB.Recordset"); ssqlstring = "Select * from Customers"; rst = con.execute(ssqlstring); %> : ASP/JScript example (query) extracting data from the recordset rst <% while (!rst.eof) { Response.write(rst("Name") + "<BR>"); rst.movenext( ); } %> A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-15

: ASP/JScript example (query) closing the recordset & connection <% rst.close( ); con.close( ); rst = null; con = null; %> DB access with relative path with the method Server.MapPath <% @LANGUAGE="JScript" %> <% var con; var constring; con = Server.CreateObject("DB.Connection"); constring = "Provider = Microsoft.Jet.OLEDB.4.0; " + "Data Source = " + Server.MapPath("./mydb.mdb"); con.open(constring);... A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-16

: example of update via SQL creating and opening the connection <% @LANGUAGE="JScript" %> <!--#include file="adojavas.inc"--> <% var con; var constring; con = Server.CreateObject("DB.Connection"); constring = "Provider=Microsoft.Jet.OLEDB.4.0; t " + "Data Source= c:\\webdata\\mydb.mdb "; con.open(constring); %> : example of update via SQL adding records and closing the connection <% var ssqlstring; ssqlstring = "INSERT INTO tbooks (Title, Description, Category) VALUES ('DB Design','How to design a database', 3);" con.execute(ssqlstring); con.close( ); con = null; %> A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-17

Reserved keywords errors may occur if table or column names corresponds with keywords of ASP or the scripting language (e.g. value) to avoid these errors, enclose the name within square brackets (e.g. [ value ] ) A.Lioy, G.Ramunno - Politecnico di Torino (2010) K-18