Post on 26-Jul-2020
transcript
November 15, 2017 Sam Siewert
CS317 File and Database Systems
Lecture 14 – Network Client Access to DBMS
http://dilbert.com/strips/comic/2010-01-18/
Reminders PLEASE FILL OUT COURSE EVALUATIONS ON CANVAS [5 points bonus on Assignment #6] Assignment #6, DBMS Project of Your Interest – POSTED – Work with your Chosen Team – Self-Directed – Autonomy, Mastery, Purpose and Life-long
Learning and Requires Some Research on Your Part
Exam #2 Completes Material – Week 15 Assignment #6 Assessed with Final Grading
Sam Siewert 2
Interdisciplinary Nature of DBMS
Sam Siewert 3
DBMS
File Systems
Operating Systems
Programming Languages (SQL, OOP)
Security
Networking (Clusters, DR, Client/Server)
Storage (SAN, NAS, DAS)
Big
Data
Analytics
?
CS332 – “R”
CS332 – C++ & Java Final Lecture – Week 14 SE300/310 – OOA/OOD/OOP
MySQL Connectors C/C++, Java, …
MYSQL CONNECTORS Application Network Connection to DBMS
Sam Siewert 4
Overview – App Connectors For MySQL (other DBMS) – Vendor DB Connectors
Sam Siewert 5
1. MS Visual Studio – ActiveX Data Objects 2. Open DB Connector (Driver) 3. JDBC, Java API to DBC 4. Python API to DBC 5. C++ API to DBC 6. C API to DBC 7. C MySQL Client (Cmd/Data Transport)
Connection Methods Driver – ODBC (Open Database Connector – Wider Range of RDBMS’s) – Send SQL Commands to a Driver (open, write, read, close) – SQL Table Data (Rows, Columns) Returned – Like any Driver, Accessible from any Programming Language
(Just Like Opening a File from Any PL) – Driver Marshalls Data To and From SQL Server and DB
Language Specific API – API Written in Language (E.g. C) Provides Connection,
Command Interface and Data Marshalling – Essentially Your Application Replaces SQL Client as an App
Specific Client
Sam Siewert 6
DB Connector Driver Connector from PL API SQL Commands and Data Marshalled over Network by the DB Connector Driver (Presentation/Session)
Sam Siewert 7
ODBC Session
ODBC Presentation
Application
Transport
Network
Link
Physical
Internet
ODBC Session
ODBC Presentation
DBMS
Transport
Network
Link
Physical
IP Router/Switch
L5
L6
L7
L4
L3
L2
L1
DB Client API API for Command and Data Transport from PL API Send SQL Command as a Message over TCP/IP Table Data Returned in Messages (Marshalled)
Sam Siewert 8
Sockets API
Conn: SQL Cmd, Data
Application
TCP
IP
IEEE 802.3z - GigE
Radio Transmission
Internet
Sockets API
Conn: SQL Cmd, Data
DBMS
TCP
IP
802.11abgn - Wireless
Cat-6 UTP
IP Router/Switch
L5
L6
L7
L4
L3
L2
L1
Recall Simplest MySQL Default SELECT for “Hello World” at Interactive Command Prompt – Remote Version?
Sam Siewert 9
Remote SQL Query Marshall the Query [and/or Data] Over to MySQL Server Daemon Acts as Network Service for an Client Write Client in Some Procedural Programming Language Send the SQL over Transport Layer to Server Listening on Socket Port and IP Address, Results Returned on Virtual Connection, Connection Dropped Requires Client Code Library and Methods
Sam Siewert 10
Building MySQL C Connector
C API Client Manual Pages See my example – conntest.c Can Run on localhost or over Network to Socket on IP Address Simple mysql> prompt written with C connector Sam Siewert 11
http://www.kitebird.com/mysql-book/
Example Run - Equivalent
Sam Siewert 12
Connector Use Example Specify host, user and password prompt for PRClab use
Sam Siewert 13
% ./conntest -h localhost -p -u siewerts Enter password: SELECT statement succeeded SELECT statement succeeded information_schema BottAK DHv1_3 G1_InterviewAttire G2_Pokedex G3_DisneyMoviesOnDemand G4_GolfStat G4_WorkoutLog G5_EGR101Scoring G5_MissionPossible G#6_Mantrist PizzaDelievery botteDHV1 botteDHV2 … testing 113 rows returned %
Take-Away DBMS + Logical DB Design is Part of The Story The Other Part are the GUIs, Applications, Web Pages, and Mobile Applications that Access the Logical DB on a DBMS Server or Cluster Most “Users” Don’t Want to Write SQL They Don’t Even Want to Issue Stored Queries (Views) They Want Data from a GUI, Web Page, App with Data
Sam Siewert 14
Summary Along with Connectors for Applications, This Completes CS317 Material Exam #2 on 12/4 and 12/6 Final Oral Exam on Saturday, Dec 9th, 8AM Material We Ran Out of Time to Cover – Distributed DBMS and Scaling – Comprehensive Final Review (Final Oral Exam Instead)
Sam Siewert 15