School of Computing and Management Sciences © Sheffield Hallam University Issues of Data Access 101(-ish) ways to access data from a database! ODBC One.

Slides:



Advertisements
Similar presentations
Connecting to Databases. connecting to DB DB server typically a standalone application Server runs on localhost for smaller sites –i.e. Same machine as.
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Database System Concepts and Architecture
Lecture plan Information retrieval (from week 11)
Copyright  Oracle Corporation, All rights reserved. 2 Java and Databases: An Overview.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
SQL (Structured Query Language) X/OPEN Call Level Interface For SQL ODBC (Open DataBase Connectivity) API JDBC (Java DataBase Connectivity) API SQL (Structured.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
14 1 Chapter 14 Database Connectivity and Web Development Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
1 C. Shahabi Application Programming for Relational Databases Cyrus Shahabi Computer Science Department University of Southern California
Oracle SQL*plus John Ortiz. Lecture 10SQL: Overview2 Overview  SQL: Structured Query Language, pronounced S. Q. L. or sequel.  A standard language for.
Lecture The Client/Server Database Environment
The Client/Server Database Environment
Chapter 2 Database System Concepts and Architecture
Web-based Software Development - An introduction.
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
Dale Roberts 8/24/ Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Getting connected.  Java application calls the JDBC library.  JDBC loads a driver which talks to the database.  We can change database engines without.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
September 6, 2015 Connecting Client Applications to Informix Databases using IBM Informix Connect and ODBC James Edmiston Database Consultant Quest Information.
Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and client-side Oracle JDBC drivers provide the same basic functionality.
How to Configure Informix Connect and ODBC James Edmiston Informix DBA Consultant/Quest Information Systems, Inc. Informix User Forum 2005 Moving Forward.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Glink: GCOS e-business in an application server architecture Summit 2000, Jim Gallagher.
Oracle9 i JDeveloper for Database Developers and DBAs Brian Fry Principal Product Manager Oracle JDeveloper Oracle Corporation.
Using Visual Basic 6.0 to Create Web-Based Database Applications
DB Libraries: An Alternative to DBMS By Matt Stegman November 22, 2005.
Fundamentals of Database Chapter 7 Database Technologies.
M1G Introduction to Database Development 6. Building Applications.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS480 Computer Science Seminar Introduction to Microsoft Solutions Framework (MSF)
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
2-1 WEB DATABSE INTERFACING Colorado Technical University IT420.
CSS/417 Introduction to Database Management Systems Workshop 4.
The Client/Server Database Environment Ployphan Sornsuwit KPRU Ref.
Database Architectures Database System Architectures Considerations – Data storage: Where do the data and DBMS reside? – Processing: Where.
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
School of Computing and Management Sciences © Sheffield Hallam University Issues of Data Access 101(-ish) ways to access data from a database! ODBC One.
Copyright © Curt Hill Connectivity Communicating with the Database.
WEB SERVER SOFTWARE FEATURE SETS
Database Connectivity and Server-Side Scripting Chapter 12.
Basics of JDBC Session 14.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
JDBC Chapter 1 JDBC Introduction
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
Glink for Java: applet, application and an API for integrating access to Bull, IBM, UNIX and Minitel systems with your Java based e-business applications.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 9: The Client/Server Database Environment Modern Database Management 9 th Edition.
Databases and DBMSs Todd S. Bacastow January 2005.
Web-based Software Development - An introduction
DEPTT. OF COMP. SC & APPLICATIONS
DBMS & TPS Barbara Russell MBA 624.
ODBC, OCCI and JDBC overview
Web Technologies IT230 Dr Mohamed Habib.
Chapter 2 Database System Concepts and Architecture
The Client/Server Database Environment
The Client/Server Database Environment
The Client/Server Database Environment
Chapter 9: The Client/Server Database Environment
Data, Databases, and DBMSs
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
ODBC and JDBC.
MATERI PL/SQL Procedures Functions Packages Database Triggers
Graduation Project #1 University Internet Student Registration System
Presentation transcript:

School of Computing and Management Sciences © Sheffield Hallam University Issues of Data Access 101(-ish) ways to access data from a database! ODBC One method in more detail: OLE DB and ADO In favour of Stored Procedures? A look at Java Stored Procedures

Server Side Client Side DriversDrivers JDBC - ODBC Bridge Forms Embe dded SQL RDBMS specific apps eg: VB Delphi etc General data aware apps eg: Specific RDBSM eg ORACLE Other ODBC compliant RDBMS SQL Databases ODBC Native JDBC Apps and applets Java JDO OLE DB Other data stores Proprietary database access protocols

School of Computing and Management Sciences © Sheffield Hallam University It works both ways You can access non-Oracle databases using Oracle client tools, such as Forms: –Heterogeneous Services (HS) include: Generic Connectivity (using Industry standards) Transparent Gateways (using proprietary calls) From a non-Oracle IDE you can make native calls, provided you have Oracle client binaries installed. And any mix in between….!

School of Computing and Management Sciences © Sheffield Hallam University Why such heterogeneousness? Departmental decision making Cheapest at the time Familiarity Organisational mergers relative “importance” of sites Personal Computing

School of Computing and Management Sciences © Sheffield Hallam University ODBC Recognised the need to get Front Ends talking to different Back Ends Resulted form work done by SAG and X/Open Version 1, from Microsoft, 1992 It is be database and language neutral, and amongst other things it: –Makes and manages database connections –Allocates/deallocates handles –executes ISO SQL –retrieves results –Accesses schema metadata

School of Computing and Management Sciences © Sheffield Hallam University ODBC It does merely expose a database’s functionality, and cant enhance it It does not allow for cross-platform functionality Version 1 and 2 suffered from a poor performance reputation. This could be more to do with the RAD environment that ODBC was often used with. –See Ken North: odbcperf.html

School of Computing and Management Sciences © Sheffield Hallam University Using OLE DB Real world information systems are increasingly made up from a series of different technologies. Organisations may have both Mainframes and client- server systems each with different databases and applications on them. There is often a need for the PC desktop to be the presenter of information. OLE DB responds to this scenario by setting out a specification for a set of low-level data access interfaces to work against many types of data store in a standard way. Use of an Oracle provider is preferred because it is a native OLE DB provider and gives access to Oracle-specific database features, such as support for LOBs, PL/SQL stored procedures, and REF CURSORs. Whilst Client needs to be 8i or higher, you can use OLE DB to access data from Oracle databases of version or higher. Only one version of OraOLEDB can exist on a machine at a time, and, because it is COM-based, OLE DB is unable to cope with multiple Oracle homes.

School of Computing and Management Sciences © Sheffield Hallam University Using ADO to hide OLE DB Microsoft ActiveX® Data Objects (ADO) is a high-level object-oriented interface to OLE DB data which presents the applications programmer with a set of objects, including a database independent recordset. It is possible to call OLE DB methods directly, but the ADO encapsulation hides the low-level complexities The extra overhead of the extra layers of abstraction can be worth it if: –An application which accesses different database platforms simultaneously –An application which needs has the ability to be used with any customer-defined database back end –In an environment where (expensive) C++ programmers with low-level database experience are hard to acquire, but where Delphi or VB skills are less hard to find Another benefit of using ADO is that you can assume that the database access layer is already in place if your clients are running MS Windows. ADO and OLE DB are supplied by Microsoft and installed with Windows. No need to worry about installing extras like the Borland Database Engine (BDE) on client machines together with your application. An ADO-based application requires that ADO 2.1 be installed on the client computer.

School of Computing and Management Sciences © Sheffield Hallam University The ADO model NOTE: Blue indicate Delphi component names that use the ADO object

School of Computing and Management Sciences © Sheffield Hallam University SQL is non-procedural –designed to be relatively approachable to non- programmers PL/SQL is a procedural extension to SQL –many Oracle products are themselves written in pl/sql –but it IS proprietary What is PL/SQL?

School of Computing and Management Sciences © Sheffield Hallam University Standard DML commands SQL functions SQL transaction control creation and control of “cursors” flow control - IF, WHEN, LOOP…. Error Handling ×DDL What can be done with PL/SQL?

School of Computing and Management Sciences © Sheffield Hallam University Anonymous Block Application Procedure or Function Database Trigger Application Trigger Stored Procedure or Function Packages Where does PL/SQL live?

School of Computing and Management Sciences © Sheffield Hallam University Stored Procedures  Major benefits are speed…. –no compilation is required at execution time. –Stored procedures are loaded once into the SGA –They remain there until they are paged out. –Subsequent executions of the stored procedure are much faster  Code management… –Stored in the data dictionary. –Can be called by many users. –Improved coding productivity

School of Computing and Management Sciences © Sheffield Hallam University Stored Procedures cont…. And Security –eg: you can grant users access to a procedure that updates a table but not grant them access to the table itself  However, DBAs need to be aware of the memory demands of stored procedures

School of Computing and Management Sciences © Sheffield Hallam University Packages Packages encapsulate related procedures, functions, and associated cursors and variables together as a unit in the database. Only packages can be pinned. Oracle provides a procedure dbms_shared_pool.keep to pin a package. Packages can be unpinned with dbms_shared_pool.unkeep.

School of Computing and Management Sciences © Sheffield Hallam University Using JDBC You can experiment using JDeveloper Connections are identified by a JDBC URL: There are a variety of implementation alternatives. Don’t assume: TEST THEM! – –Top 10 tips:

School of Computing and Management Sciences © Sheffield Hallam University Selecting a JDBC driver  If you are writing an applet, you must use the JDBC Thin driver. JDBC OCI-based driver classes will not work inside a Web browser, because they call native methods.  If you want maximum portability and performance under Oracle8i and earlier, then use the JDBC Thin driver. You can connect to an Oracle server from either an application or an applet using the JDBC Thin driver.  If you are writing a client application for an Oracle client environment and need maximum performance, then choose the JDBC OCI driver.  For code that runs in an Oracle server acting as a middle tier, use the server-side Thin driver.  If your code will run inside the target Oracle server, then use the JDBC server-side internal driver to access that server.  If performance is critical to your application, or you want maximum scalability of the Oracle server, choose the OCI driver Adapted from Oracle manual

School of Computing and Management Sciences © Sheffield Hallam University Java Stored Procedures  This demonstration starts us off on the path of using server-side JDBC for Stored Procs  The four steps are:  Write the Java Procedures  Load the Class into the database  Publish the procedure(s) to make them available in SQL  Test them  This example is a Java class which will contain procedures for producing lists from BSMS

Java Stored Procedures  Write the Java Procedures  Watch out: filename MUST = class name  see BSMSLists.javaBSMSLists.java  Load the Class into the database  From the Command prompt, use the LoadJava utility in the Oracle_Home bin folder  Only get feedback if errors

Java Stored Procedures  Publish the procedure(s) to make them available in SQL:

Java Stored Procedures  Test them

School of Computing and Management Sciences © Sheffield Hallam University JSP: More reading  Metalink Note : Java Stored Procedures in 8i  Oracle manual online: Java Stored Procedures Developer's Guide