FIT2094 Lecture Notes - Lecture 11: Java Database Connectivity, Application Programming Interface, Oracle Application Express
L11: Database Connectivity!
Database Connectivity !
▪ The DATA LAYER – your data management application (DBMS) !
▪ The DATABASE MIDDLEWARE – manages connectivity and data transformation issues. Many
options available such as: !
– Native SQL Connectivity"
• Vendor provided eg. Oracle SQL*Net !
– Microsoft ODBC, DAO, RDO; OLE-DB and ADO.NET !
– Java Database Connectivity (JDBC) !
▪ The APPLICATION – the external interface, mostly in the form of an Application Programming
Interface (API) !
Web Database Development !
▪ Creating web pages which access data in a database. Many options available, including !
– ColdFusion Uses CFML - https://goo.gl/7FnYgi or http://openbd.org/ – PHP - http://php.net/"
– Oracle Application Express (Apex) !
▪ ▪ !
PHP Database Access !
Oracle interaction via Oracle OCI 8 functions (https://goo.gl/lR8Vi) Set up login details: !
!
$dbUserName = "username"; $dbPassword = "whatever"; !
<<< database user <<< database password !
<<< database to connect to !
$dbInstance = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=fit2094.corp-
prd.aws.monash.edu)(PORT=1521)) (CONNECT_DATA=(SID=FIT2094)))"; !
PHP Database Access Build Query String ($query) !
Parse statement (SQL select in $query string) $stmt = oci_parse($conn,$query); !
Execute the statement !
$r = oci_execute($stmt); Fetch the results of the Query while (oci_fetch($stmt)) { !
...... } !
– generate HTML output for web page to be returned
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Database connectivity: the data layer your data management application (dbms, the database middleware manages connectivity and data transformation issues. Native sql connectivity: vendor provided eg. oracle sql*net. Microsoft odbc, dao, rdo; ole-db and ado. net. Java database connectivity (jdbc: the application the external interface, mostly in the form of an application programming. Web database development: creating web pages which access data in a database. Coldfusion uses cfml - https://goo. gl/7fnygi or http://openbd. org/ php - http://php. net/ Oracle interaction via oracle oci 8 functions (https://goo. gl/lr8vi) set up login details: Parse statement (sql select in string) = oci_parse(,); = oci_execute(); fetch the results of the query while (oci_fetch()) {