C:/Users/zzaier/Documents/NetBeansProjects/WebApplication4/src/java/mainpackage/MainClass.java

Size: px
Start display at page:

Download "C:/Users/zzaier/Documents/NetBeansProjects/WebApplication4/src/java/mainpackage/MainClass.java"

Transcription

1 package mainpackage; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import javax.ws.rs.core.context; import javax.ws.rs.core.uriinfo; import javax.ws.rs.pathparam; import javax.ws.rs.consumes; import javax.ws.rs.produces; import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.put; import net.sf.json.jsonarray; import net.sf.json.jsonobject; /** * REST Web Service * zzaier public class MainClass { /** args the command line arguments */ // JDBC driver name and database URL static final String JDBC_DRIVER = "oracle.jdbc.oracledriver"; static final String DB_URL = "jdbc:oracle:thin:@ :1521:xe"; // Database credentials static final String USER = "hr"; static final String PASS = private UriInfo context; /** * Creates a new instance of MainClass 1.1 of :05:32

2 1.2 of :05:32

3 */ public @Produces("application/json") public String getjsonemployees() { Connection conn = null; Statement stmt = null; try{ //STEP 2: Register JDBC driver Class.forName(JDBC_DRIVER); //STEP 3: Open a connection System.out.println("Connecting to database..."); conn = DriverManager.getConnection(DB_URL,USER,PASS); //STEP 4: Execute a query System.out.println("Creating statement..."); stmt = conn.createstatement(); String sql; sql = "SELECT * FROM employees e natural join jobs j left join " + "departments d on d.department_id=e.department_id"; ResultSet rs = stmt.executequery(sql); //STEP 5: Extract data from result set JSONArray listemployees= new JSONArray(); JSONObject singleemployee= new JSONObject(); while(rs.next()){ //Retrieve by column name String fname = rs.getstring("first_name"); String lname = rs.getstring("last_name"); double salary = rs.getdouble("salary"); String jobtitle = rs.getstring("job_title"); String departmentname = rs.getstring("department_name"); //Display values singleemployee.accumulate("first_name", fname); singleemployee.accumulate("last_name", lname); singleemployee.accumulate("salary", salary); 2.1 of :05:32

4 2.2 of :05:32

5 singleemployee.accumulate("jobtitle", jobtitle); singleemployee.accumulate("departmentname", departmentname); listemployees.add(singleemployee); singleemployee.clear(); System.out.println(listEmployees.toString()); //STEP 9: Clean-up environment rs.close(); stmt.close(); conn.close(); return listemployees.tostring(); catch(sqlexception se){ //Handle errors for JDBC se.printstacktrace(); catch(exception e){ //Handle errors for Class.forName e.printstacktrace(); System.out.println("Goodbye!"); @Produces("application/json") public String getjsonlocation() { Connection conn = null; Statement stmt = null; try{ //STEP 2: Register JDBC driver Class.forName(JDBC_DRIVER); //STEP 3: Open a connection System.out.println("Connecting to database..."); conn = DriverManager.getConnection(DB_URL,USER,PASS); //STEP 4: Execute a query System.out.println("Creating statement..."); stmt = conn.createstatement(); String sql; sql = "SELECT * FROM locations natural join countries natural join regions 3.1 of :05:32

6 s"; 3.2 of :05:32

7 ResultSet rs = stmt.executequery(sql); //STEP 5: Extract data from result set JSONArray listlocations= new JSONArray(); JSONObject singlelocation= new JSONObject(); while(rs.next()){ //Retrieve by column name String city = rs.getstring("city"); String street = rs.getstring("street_address"); String country = rs.getstring("country_name"); String region = rs.getstring("region_name"); //Display values singlelocation.accumulate("city", city); singlelocation.accumulate("street", street); singlelocation.accumulate("country", country); singlelocation.accumulate("region", region); listlocations.add(singlelocation); singlelocation.clear(); System.out.println(listLocations.toString()); //STEP 9: Clean-up environment rs.close(); stmt.close(); conn.close(); return listlocations.tostring(); catch(sqlexception se){ //Handle errors for JDBC se.printstacktrace(); catch(exception e){ //Handle errors for Class.forName e.printstacktrace(); System.out.println("Goodbye!"); @Produces("application/json") 4.1 of :05:32

8 4.2 of :05:32

9 public String theid) { Connection conn = null; Statement stmt = null; try{ //STEP 2: Register JDBC driver Class.forName(JDBC_DRIVER); //STEP 3: Open a connection System.out.println("Connecting to database..."); conn = DriverManager.getConnection(DB_URL,USER,PASS); //STEP 4: Execute a query System.out.println("Creating statement..."); stmt = conn.createstatement(); String sql; sql = "SELECT * FROM employees e natural join jobs j left join " + "departments d on d.department_id=e.department_id " + "where e.employee_id="+theid; ResultSet rs = stmt.executequery(sql); //STEP 5: Extract data from result set JSONObject singleemployee= new JSONObject(); if(rs.next()){ //Retrieve by column name String fname = rs.getstring("first_name"); String lname = rs.getstring("last_name"); double salary = rs.getdouble("salary"); String jobtitle = rs.getstring("job_title"); String departmentname = rs.getstring("department_name"); //Display values singleemployee.accumulate("first_name", fname); singleemployee.accumulate("last_name", lname); singleemployee.accumulate("salary", salary); singleemployee.accumulate("jobtitle", jobtitle); singleemployee.accumulate("departmentname", departmentname); else{ singleemployee.accumulate("message","employee Not Available" ); 5.1 of :05:32

10 5.2 of :05:32

11 System.out.println(singleEmployee.toString()); //STEP 9: Clean-up environment rs.close(); stmt.close(); conn.close(); return singleemployee.tostring(); catch(sqlexception se){ //Handle errors for JDBC se.printstacktrace(); catch(exception e){ //Handle errors for Class.forName e.printstacktrace(); System.out.println("Goodbye!"); @Produces("application/json") public String theid) { Connection conn = null; Statement stmt = null; try{ //STEP 2: Register JDBC driver Class.forName(JDBC_DRIVER); //STEP 3: Open a connection System.out.println("Connecting to database..."); conn = DriverManager.getConnection(DB_URL,USER,PASS); //STEP 4: Execute a query System.out.println("Creating statement..."); stmt = conn.createstatement(); String sql; sql = "SELECT * FROM employees e left join job_history j on " + "e.employee_id=j.employee_id left join jobs d on " + "d.job_id=j.job_id where e.employee_id="+theid; ResultSet rs = stmt.executequery(sql); 6.1 of :05:32

12 6.2 of :05:32

13 //STEP 5: Extract data from result set JSONObject singleemployee= new JSONObject(); JSONObject singlejob= new JSONObject(); JSONArray listjobs= new JSONArray(); if (rs.next()){ //Retrieve by column name String fname = rs.getstring("first_name"); String lname = rs.getstring("last_name"); //Display values singleemployee.accumulate("first_name", fname); singleemployee.accumulate("last_name", lname); do { String jobtitle = rs.getstring("job_title"); String start = rs.getstring("start_date"); String end = rs.getstring("end_date"); if(jobtitle!=null){ singlejob.clear(); singlejob.accumulate("jobtitle", jobtitle); singlejob.accumulate("startdate", start); singlejob.accumulate("enddate", end); listjobs.add(singlejob); while(rs.next()); singleemployee.accumulate("jobhistory",listjobs); else{ singleemployee.accumulate("message","employee Not Available" ); System.out.println(singleEmployee.toString()); //STEP 9: Clean-up environment rs.close(); 7.1 of :05:32

14 7.2 of :05:32

15 stmt.close(); conn.close(); return singleemployee.tostring(); catch(sqlexception se){ //Handle errors for JDBC se.printstacktrace(); catch(exception e){ //Handle errors for Class.forName e.printstacktrace(); System.out.println("Goodbye!"); return "{"; 8.1 of :05:32

16 8.2 of :05:32

Java Database Connectivity (JDBC) 25.1 What is JDBC?

Java Database Connectivity (JDBC) 25.1 What is JDBC? PART 25 Java Database Connectivity (JDBC) 25.1 What is JDBC? JDBC stands for Java Database Connectivity, which is a standard Java API for database-independent connectivity between the Java programming

More information

SQream Connector JDBC SQream Technologies Version 2.9.3

SQream Connector JDBC SQream Technologies Version 2.9.3 SQream Connector JDBC 2.9.3 SQream Technologies 2019-03-27 Version 2.9.3 Table of Contents The SQream JDBC Connector - Overview...................................................... 1 1. API Reference............................................................................

More information

Topic 12: Database Programming using JDBC. Database & DBMS SQL JDBC

Topic 12: Database Programming using JDBC. Database & DBMS SQL JDBC Topic 12: Database Programming using JDBC Database & DBMS SQL JDBC Database A database is an integrated collection of logically related records or files consolidated into a common pool that provides data

More information

Unit 3 - Java Data Base Connectivity

Unit 3 - Java Data Base Connectivity Two-Tier Database Design The two-tier is based on Client-Server architecture. The direct communication takes place between client and server. There is no mediator between client and server. Because of

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer About the Tutorial JDBC API is a Java API that can access any kind of tabular data, especially data stored in a Relational Database. JDBC works with Java on a variety of platforms, such as Windows, Mac

More information

Cập nhật ResultSet trong JDBC

Cập nhật ResultSet trong JDBC java_jdbc/index.jsp Cập nhật ResultSet trong JDBC Tương tự như khi quan sát dữ liệu trong ResultSet, bạn có thể sử dụng rất nhiều phương thức (có 2 phiên bản cho chỉ mục cột và tên cột) của ResultSet Interface

More information

Preview from Notesale.co.uk Page 21 of 162

Preview from Notesale.co.uk Page 21 of 162 import java.sql.*; public class FirstExample { // JDBC driver name and database URL static final String JDBC_DRIVER = "com.mysql.jdbc.driver"; static final String DB_URL = "jdbc:mysql://localhost/emp";

More information

Java Database Connectivity

Java Database Connectivity Java Database Connectivity INTRODUCTION Dr. Syed Imtiyaz Hassan Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. s.imtiyaz@jamiahamdard.ac.in Agenda Introduction

More information

Java. Curs 2. Danciu Gabriel Mihail. Septembrie 2018

Java. Curs 2. Danciu Gabriel Mihail. Septembrie 2018 Java Curs 2 Danciu Gabriel Mihail Septembrie 2018 Cuprins Operatori Clase Pachete Prezentare java.lang Introducere în baze de date Operatori aritmetici Operatorii pe biţi Operatori pe biţi: exemplu class

More information

DATABASE DESIGN I - 1DL300

DATABASE DESIGN I - 1DL300 DATABASE DESIGN I - 1DL300 Fall 2010 An introductory course on database systems http://www.it.uu.se/edu/course/homepage/dbastekn/ht10/ Manivasakan Sabesan Uppsala Database Laboratory Department of Information

More information

COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA

COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA COP4540 TUTORIAL PROFESSOR: DR SHU-CHING CHEN TA: H S IN-YU HA OUTLINE Postgresql installation Introduction of JDBC Stored Procedure POSTGRES INSTALLATION (1) Extract the source file Start the configuration

More information

DB I. 1 Dr. Ahmed ElShafee, Java course

DB I. 1 Dr. Ahmed ElShafee, Java course Lecture (15) DB I Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, Java course Agenda 2 Dr. Ahmed ElShafee, Java course Introduction Java uses something called JDBC (Java Database Connectivity) to connect to databases.

More information

Servlet 5.1 JDBC 5.2 JDBC

Servlet 5.1 JDBC 5.2 JDBC 5 Servlet Java 5.1 JDBC JDBC Java DataBase Connectivity Java API JDBC Java Oracle, PostgreSQL, MySQL Java JDBC Servlet OpenOffice.org ver. 2.0 HSQLDB HSQLDB 100% Java HSQLDB SQL 5.2 JDBC Java 1. JDBC 2.

More information

1. PhP Project. Create a new PhP Project as shown below and click next

1. PhP Project. Create a new PhP Project as shown below and click next 1. PhP Project Create a new PhP Project as shown below and click next 1 Choose Local Web Site (Apache 24 needs to be installed) Project URL is http://localhost/projectname Then, click next We do not use

More information

Visit for more.

Visit  for more. Chapter 6: Database Connectivity Informatics Practices Class XII (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra, PGT (Comp.Sc.)

More information

Databases 2012 Embedded SQL

Databases 2012 Embedded SQL Databases 2012 Christian S. Jensen Computer Science, Aarhus University SQL is rarely written as ad-hoc queries using the generic SQL interface The typical scenario: client server database SQL is embedded

More information

CHAPTER 2 JDBC FUNDAMENTALS

CHAPTER 2 JDBC FUNDAMENTALS CHAPTER 2 JDBC FUNDAMENTALS OBJECTIVES After completing JDBC Fundamentals, you will be able to: Know the main classes in the JDBC API, including packages java.sql and javax.sql Know the difference between

More information

More Database Programming. CS157A Chris Pollett Nov. 2, 2005.

More Database Programming. CS157A Chris Pollett Nov. 2, 2005. More Database Programming CS157A Chris Pollett Nov. 2, 2005. Outline JDBC SQLJ Introduction Last day we went over some JDBC and SQLJ code examples from prior classes. Today, we will discuss JDBC and SQLJ

More information

Three-Tier Architecture

Three-Tier Architecture Three-Tier Architecture Located @ Any PC HTTP Requests Microsoft Internet Explorer HTML Located @ Your PC Apache Tomcat App Server Java Server Pages (JSPs) JDBC Requests Tuples Located @ DBLab MS SQL Server

More information

VanillaCore Walkthrough Part 1. Introduction to Database Systems DataLab CS, NTHU

VanillaCore Walkthrough Part 1. Introduction to Database Systems DataLab CS, NTHU VanillaCore Walkthrough Part 1 Introduction to Database Systems DataLab CS, NTHU 1 The Architecture VanillaDB JDBC/SP Interface (at Client Side) Remote.JDBC (Client/Server) Query Interface Remote.SP (Client/Server)

More information

Accessing a database from Java. Using JDBC

Accessing a database from Java. Using JDBC Accessing a database from Java Using JDBC We ve got a fuzzbox and we re gonna use it Now we know a little about databases and SQL. So how do we access a database from a Java application? There is an API

More information

The Many Faces Of Apache Ignite. David Robinson, Software Engineer May 13, 2016

The Many Faces Of Apache Ignite. David Robinson, Software Engineer May 13, 2016 The Many Faces Of Apache Ignite David Robinson, Software Engineer May 13, 2016 A Face In elementary geometry, a face is a two-dimensional polygon on the boundary of a polyhedron. 2 Attribution:Robert Webb's

More information

Accessing databases in Java using JDBC

Accessing databases in Java using JDBC Accessing databases in Java using JDBC Introduction JDBC is an API for Java that allows working with relational databases. JDBC offers the possibility to use SQL statements for DDL and DML statements.

More information

DataBase Lab JAVA-DATABASE CONNECTION. Eng. Haneen El-masry

DataBase Lab JAVA-DATABASE CONNECTION. Eng. Haneen El-masry In the name of Allah Islamic University of Gaza Faculty of Engineering Computer Engineering Department ECOM 4113 DataBase Lab Lab # 9 JAVA-DATABASE CONNECTION El-masry 2013 Objective In this lab, we turn

More information

A hybrid replication routing protocol for delay tolerant networks

A hybrid replication routing protocol for delay tolerant networks A hybrid replication routing protocol for delay tolerant networks Richard Joy, Miriam Joy, Serena Mei, Suyog Parajuli George Mason University Fairfax, Virginia [rjoy, mjoy, smei, sparaju3]@gmu.edu Abstract

More information

This lecture. Databases - JDBC I. Application Programs. Database Access End Users

This lecture. Databases - JDBC I. Application Programs. Database Access End Users This lecture Databases - I The lecture starts discussion of how a Java-based application program connects to a database using. (GF Royle 2006-8, N Spadaccini 2008) Databases - I 1 / 24 (GF Royle 2006-8,

More information

CSC System Development with Java. Database Connection. Department of Statistics and Computer Science. Budditha Hettige

CSC System Development with Java. Database Connection. Department of Statistics and Computer Science. Budditha Hettige CSC 308 2.0 System Development with Java Database Connection Budditha Hettige Department of Statistics and Computer Science Budditha Hettige 1 From database to Java There are many brands of database: Microsoft

More information

Lab # 9. Java to Database Connection

Lab # 9. Java to Database Connection Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 9 Java to Database Connection Eng. Haneen El-Masry December, 2014 2 Objective In this lab, we turn

More information

CHAPTER 2 JDBC FUNDAMENTALS

CHAPTER 2 JDBC FUNDAMENTALS CHAPTER 2 JDBC FUNDAMENTALS OBJECTIVES After completing JDBC Fundamentals, you will be able to: Know the main classes in the JDBC API, including packages java.sql and javax.sql Know the difference between

More information

IBM Netezza JDBC 연동가이드

IBM Netezza JDBC 연동가이드 개발및운영 IBM Netezza JDBC 연동가이드 2015. 08. 31 IBM Netezza JDBC 연동가이드 1. Netezza 개요 IBM Netezza 데이터웨어하우스어플라이언스는서버, 스토리지및데이터베이스를어플라이언스에통합하여빅데 이터에대한분석을수행합니다. 2. Netezza JDBC 연동방법 2.1 Netezza JDBC Driver nzjdbc3.jar

More information

Database connectivity (II)

Database connectivity (II) Lecture (07) Database connectivity (II) Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems Agenda Connecting DB 2 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems The

More information

while (rs.next()) { String[] temp_array = {"","",""}; int prodid = rs.getint(1); temp_array[0] = ""+prodid;

while (rs.next()) { String[] temp_array = {,,}; int prodid = rs.getint(1); temp_array[0] = +prodid; import java.sql.connection; import java.sql.drivermanager; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import java.util.arraylist; import java.util.scanner; public

More information

The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets

The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets Course Name: Advanced Java Lecture 13 Topics to be covered The Design of JDBC The Structured Query Language Basic JDBC Programming Concepts Query Execution Scrollable and Updatable Result Sets Introducing

More information

Java and the Java DataBase Connectivity (JDBC) API. Todd Kaufman April 25, 2002

Java and the Java DataBase Connectivity (JDBC) API. Todd Kaufman April 25, 2002 Java and the Java DataBase Connectivity (JDBC) API Todd Kaufman April 25, 2002 Agenda BIO Java JDBC References Q&A Speaker 4 years Java experience 4 years JDBC experience 3 years J2EE experience BS from

More information

Döcu Content IBM Notes Domino, DB2 Oracle JDeveloper, WebLogic

Döcu Content IBM Notes Domino, DB2 Oracle JDeveloper, WebLogic Döcu Content IBM Notes Domino, DB2 Oracle JDeveloper, WebLogic Research/Create App Classes +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>> 2015.10.31.9.56.AM Getting IBM Lotus Notes

More information

CSCI/CMPE Object-Oriented Programming in Java JDBC. Dongchul Kim. Department of Computer Science University of Texas Rio Grande Valley

CSCI/CMPE Object-Oriented Programming in Java JDBC. Dongchul Kim. Department of Computer Science University of Texas Rio Grande Valley CSCI/CMPE 3326 Object-Oriented Programming in Java JDBC Dongchul Kim Department of Computer Science University of Texas Rio Grande Valley Introduction to Database Management Systems Storing data in traditional

More information

Introduction to Databases

Introduction to Databases JAVA JDBC Introduction to Databases Assuming you drove the same number of miles per month, gas is getting pricey - maybe it is time to get a Prius. You are eating out more month to month (or the price

More information

Introduction to SQL & Database Application Development Using Java

Introduction to SQL & Database Application Development Using Java Introduction to SQL & Database Application Development Using Java By Alan Andrea The purpose of this paper is to give an introduction to relational database design and sql with a follow up on how these

More information

Enterprise Java Unit 1- Chapter 6 Prof. Sujata Rizal

Enterprise Java Unit 1- Chapter 6 Prof. Sujata Rizal Introduction JDBC is a Java standard that provides the interface for connecting from Java to relational databases. The JDBC standard is defined by Sun Microsystems and implemented through the standard

More information

ERwin and JDBC. Mar. 6, 2007 Myoung Ho Kim

ERwin and JDBC. Mar. 6, 2007 Myoung Ho Kim ERwin and JDBC Mar. 6, 2007 Myoung Ho Kim ERwin ERwin a popular commercial ER modeling tool» other tools: Dia (open source), Visio, ConceptDraw, etc. supports database schema generation 2 ERwin UI 3 Data

More information

Wentworth Institute of Technology COMP570 Database Applications Fall 2014 Derbinsky. SQL Programming. Lecture 8. SQL Programming

Wentworth Institute of Technology COMP570 Database Applications Fall 2014 Derbinsky. SQL Programming. Lecture 8. SQL Programming Lecture 8 1 Outline Context General Approaches Typical Programming Sequence Examples 2 Database Design and Implementation Process Normalization 3 SQL via API Embedded SQL SQLJ General Approaches DB Programming

More information

JDBC drivers are divided into four types or levels. The different types of jdbc drivers are:

JDBC drivers are divided into four types or levels. The different types of jdbc drivers are: How many types of JDBC Drivers are present and what are they? JDBC drivers are divided into four types or levels. The different types of jdbc drivers are: Type 1: JDBC-ODBC Bridge driver (Bridge) Type

More information

Web Applications and Database Connectivity using JDBC (Part II)

Web Applications and Database Connectivity using JDBC (Part II) Web Applications and Database Connectivity using JDBC (Part II) Advanced Topics in Java Khalid Azim Mughal khalid@ii.uib.no http://www.ii.uib.no/~khalid/atij/ Version date: 2007-02-08 ATIJ Web Applications

More information

Logging and Recovery. 444 Section, April 23, 2009

Logging and Recovery. 444 Section, April 23, 2009 Logging and Recovery 444 Section, April 23, 2009 Reminders Project 2 out: Due Wednesday, Nov. 4, 2009 Homework 1: Due Wednesday, Oct. 28, 2009 Outline Project 2: JDBC ACID: Recovery Undo, Redo logging

More information

SQL Client Example using KnoxShell in Apache Knox

SQL Client Example using KnoxShell in Apache Knox SQL Client Example using KnoxShell in Apache Knox The KnoxShell release artifact provides a small footprint client environment that removes all unnecessary server dependencies, configuration, binary scripts,

More information

access to a JCA connection in WebSphere Application Server

access to a JCA connection in WebSphere Application Server Understanding connection transitions: Avoiding multithreaded access to a JCA connection in WebSphere Application Server Anoop Ramachandra (anramach@in.ibm.com) Senior Staff Software Engineer IBM 09 May

More information

Instructor: Jinze Liu. Fall 2008

Instructor: Jinze Liu. Fall 2008 Instructor: Jinze Liu Fall 2008 Database Project Database Architecture Database programming 2 Goal Design and implement a real application? Jinze Liu @ University of Kentucky 9/16/2008 3 Goal Design and

More information

You write standard JDBC API application and plug in the appropriate JDBC driver for the database the you want to use. Java applet, app or servlets

You write standard JDBC API application and plug in the appropriate JDBC driver for the database the you want to use. Java applet, app or servlets JDBC Stands for Java Database Connectivity, is an API specification that defines the following: 1. How to interact with database/data-source from Java applets, apps, servlets 2. How to use JDBC drivers

More information

Project Documentation

Project Documentation Project Documentation A JDBC Driver Supporting Data Integration and Evolution Jian Jia Goals University of Iowa, Iowa City, IA jjia@cs.uiowa.edu This project will produce a Unity JDBC Driver that is compliant

More information

An IBM Rational Software TechNote

An IBM Rational Software TechNote Data Driven Testing: How to Create a Data Driven Test with XDE Tester An IBM Rational Software TechNote 1 Creating a Data-Driven Test with XDE Tester By Dr. Gerd Weishaar The samples provided in the advanced

More information

JDBC [Java DataBase Connectivity]

JDBC [Java DataBase Connectivity] JDBC [Java DataBase Connectivity] Introduction Almost all the web applications need to work with the data stored in the databases. JDBC is Java specification that allows the Java programs to access the

More information

Tiers (or layers) Separation of concerns

Tiers (or layers) Separation of concerns Tiers (or layers) Separation of concerns Hiding the type of storage from the client class Let s say we have a program that needs to fetch objects from a storage. Should the program have to be concerned

More information

3) execute() Usage: when you cannot determine whether SQL is an update or query return true if row is returned, use getresultset() to get the

3) execute() Usage: when you cannot determine whether SQL is an update or query return true if row is returned, use getresultset() to get the Agenda Lecture (07) Database connectivity (II) Connecting DB Dr. Ahmed ElShafee 1 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems 2 Dr. Ahmed ElShafee, ACU Spring 2011, Distributed Systems The

More information

Coleman Leviter, OCP IBM/NYC MTA/IOUG Oracle Database Developer

Coleman Leviter, OCP IBM/NYC MTA/IOUG Oracle Database Developer JAVA and Oracle - The good, better and best Wednesday, June 28th, 8PM - 9PM NYOUG Meetup Coleman Leviter, OCP IBM/NYC MTA/IOUG Oracle Database Developer cleviter@ieee.org 1 CV - NYC MTA, Consultant - VAX

More information

Database Application Development Part 2 - Chapter

Database Application Development Part 2 - Chapter Database Application Development Part 2 - Chapter 6.3-6.7 http://xkcd.com/327 -- CC BY-NC 2.5 Randall Munroe Comp 521 Files and Databases Fall 2014 1 Alternative Approach v Abstract Database interface

More information

Database Lab#9 Connecting to postgresql database from java programs

Database Lab#9 Connecting to postgresql database from java programs Database Lab#9 Connecting to postgresql database from java programs A client program written in java language can connect to a database server by using JDBC (java database connectivity) library. Classes

More information

Using a CVP VoiceXML application to implement a logical shadow queue for ICM

Using a CVP VoiceXML application to implement a logical shadow queue for ICM Using a CVP VoiceXML application to implement a logical shadow queue for ICM Introduction When calls are queuing in ICM, situations can arise in which greater visibility of the queue contents is required

More information

School of Computing and Information Technology. Examination Paper Autumn Session 2017

School of Computing and Information Technology. Examination Paper Autumn Session 2017 School of Computing and Information Technology CSIT115 Data Management and Security Wollongong Campus Student to complete: Family name Other names Student number Table number Examination Paper Autumn Session

More information

Chapter 10 Java and SQL. Wang Yang

Chapter 10 Java and SQL. Wang Yang Chapter 10 Java and SQL Wang Yang wyang@njnet.edu.cn Outline Concern Data - File & IO vs. Database &SQL Database & SQL How Connect Java to SQL - Java Model for Database Java Database Connectivity (JDBC)

More information

WebSphere Connection Pooling. by Deb Erickson Shawn Lauzon Melissa Modjeski

WebSphere Connection Pooling. by Deb Erickson Shawn Lauzon Melissa Modjeski WebSphere Connection Pooling by Deb Erickson Shawn Lauzon Melissa Modjeski Note: Before using this information and the product it supports, read the information in "Notices" on page 78. First Edition (August

More information

Programming in Java

Programming in Java 320341 Programming in Java Fall Semester 2014 Lecture 16: Introduction to Database Programming Instructor: Slides: Jürgen Schönwälder Bendick Mahleko Objectives This lecture introduces the following -

More information

MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065)

MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065) MANTHLY TEST SEPTEMBER 2017 QUESTION BANK CLASS: XII SUBJECT: INFORMATICS PRACTICES (065) DATABASE CONNECTIVITY TO MYSQL Level- I Questions 1. What is the importance of java.sql.*; in java jdbc connection?

More information

How to program applications. CS 2550 / Spring 2006 Principles of Database Systems. SQL is not enough. Roadmap

How to program applications. CS 2550 / Spring 2006 Principles of Database Systems. SQL is not enough. Roadmap How to program applications CS 2550 / Spring 2006 Principles of Database Systems 05 SQL Programming Using existing languages: Embed SQL into Host language ESQL, SQLJ Use a library of functions Design a

More information

JDBC Architecture. JDBC API: This provides the application-to- JDBC Manager connection.

JDBC Architecture. JDBC API: This provides the application-to- JDBC Manager connection. JDBC PROGRAMMING JDBC JDBC Java DataBase Connectivity Useful for database driven applications Standard API for accessing relational databases Compatible with wide range of databases Current Version JDBC

More information

UNIT-3 Java Database Client/Server

UNIT-3 Java Database Client/Server UNIT-3 Java Database Client/Server TOPICS TO BE COVERED 3.1 Client-Server Design: Two-Tier Database Design, Three-Tier Database Design 3.2 The JDBC API: The API Components, Database Creation, table creation

More information

CSE 135. Three-Tier Architecture. Applications Utilizing Databases. Browser. App. Server. Database. Server

CSE 135. Three-Tier Architecture. Applications Utilizing Databases. Browser. App. Server. Database. Server CSE 135 Applications Utilizing Databases Three-Tier Architecture Located @ Any PC HTTP Requests Browser HTML Located @ Server 2 App Server JDBC Requests JSPs Tuples Located @ Server 1 Database Server 2

More information

S.No File Name Path Description 1 DataSourceElement.java Jmeter/src/protocol/jdbc/org/a pache/jmeter/protocol/jdbc/ autocsv_jdbcconfig

S.No File Name Path Description 1 DataSourceElement.java Jmeter/src/protocol/jdbc/org/a pache/jmeter/protocol/jdbc/ autocsv_jdbcconfig AutoCSV_jdbc config For testing an application which has a form or request that takes multiple data entries from a large number of users and the data entries are required to be unique for different users,it

More information

CSC309: Introduction to Web Programming. Lecture 13

CSC309: Introduction to Web Programming. Lecture 13 CSC309: Introduction to Web Programming Lecture 13 Wael Aboulsaadat University of Toronto Web-apps Architecture University of Toronto 2 N-Tier model + MQ + SP Presentation Layer HTML/CSS/JS/JSP/... Presentation

More information

WEB SERVICES EXAMPLE 2

WEB SERVICES EXAMPLE 2 INTERNATIONAL UNIVERSITY HCMC PROGRAMMING METHODOLOGY NONG LAM UNIVERSITY Instructor: Dr. Le Thanh Sach FACULTY OF IT WEBSITE SPECIAL SUBJECT Student-id: Instructor: LeMITM04015 Nhat Tung Course: IT.503

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) SQL-Part III & Storing Data: Disks and Files- Part I Lecture 8, February 5, 2014 Mohammad Hammoud Today Last Session: Standard Query Language (SQL)- Part II Today s Session:

More information

Databases and JDBC. by Vlad Costel Ungureanu for Learn Stuff

Databases and JDBC. by Vlad Costel Ungureanu for Learn Stuff Databases and JDBC by Vlad Costel Ungureanu for Learn Stuff Working with Databases Create database using SQL scripts Connect to the database server using a driver Communicate with the database Execute

More information

Prof. Edwar Saliba Júnior

Prof. Edwar Saliba Júnior 2 3 /** 4 * 5 * @author Cynthia Lopes 6 * @author Edwar Saliba Júnior 7 */ 8 import java.io. o.filenotfoundexception; 9 import java.io. o.ioexception; 10 import java.sql.sqlexception; 11 import java.sql.statement;

More information

Chettinad College of Engineering and Technology CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND TECHNOLOGY

Chettinad College of Engineering and Technology CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND TECHNOLOGY CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND TECHNOLOGY UNIT IV SERVLETS 1. What is Servlets? a. Servlets are server side components that provide a powerful mechanism

More information

Content Services for JDBC Driver User Guide

Content Services for JDBC Driver User Guide Content Services for JDBC Driver User Guide Version 5.3 SP1 August 2005 Copyright 1994-2005 EMC Corporation. All rights reserved Table of Contents Preface... 7 Chapter 1 Introducing Content Services for

More information

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Copyright 2012, Oracle and/or its affiliates. All rights reserved. 1 ADF Mobile The Data Layer 2 Mobile Device Device Services ADF Mobile Architecture Device Native Container HTML5 & JavaScript Presentation Phone Gap Native View ADF Mobile XML View ADF Controller Local

More information

Departamento de Lenguajes y Sistemas Informáticos

Departamento de Lenguajes y Sistemas Informáticos Departamento de Lenguajes y Sistemas Informáticos ! " # $% &'' () * +, ! -. /,#0 &. +, +*,1 $23.*4.5*46.-.2) 7.,8 +*,1 $ 6 +*,1) $23.*4.5 7.-.2) 9 :$java.sql.*),,1 $ ;0,9,1

More information

JBASE JDBC DRIVER VERSION 1.0

JBASE JDBC DRIVER VERSION 1.0 JBASE JDBC DRIVER VERSION 1.0 i Copyright Copyright (c) 2005 TEMENOS HOLDINGS NV All rights reserved. This document contains proprietary information that is protected by copyright. No part of this document

More information

Sub: Advance Java Programming Laboratory

Sub: Advance Java Programming Laboratory 1. Write a JAVA Servlet program to implement a dynamic HTML, using the servlet. (user name and password should be accepted using HTML and displayed using a Servlet) /**************** HTML CODE ******************/

More information

CreateServlet.java

CreateServlet.java Classes in OBAAS 1.2: -------------------- The package name is pack_bank. Create this package in java source of your project. Create classes as per the class names provided here. You can then copy the

More information

Oracle Database 10g Java Web

Oracle Database 10g Java Web Oracle Database 10g Java Web 2005 5 Oracle Database 10g Java Web... 3... 3... 4... 4... 4 JDBC... 5... 5... 5 JDBC... 6 JDBC... 8 JDBC... 9 JDBC... 10 Java... 11... 12... 12... 13 Oracle Database EJB RMI/IIOP...

More information

EJB - ACCESS DATABASE

EJB - ACCESS DATABASE EJB - ACCESS DATABASE http://www.tutorialspoint.com/ejb/ejb_access_database.htm Copyright tutorialspoint.com EJB 3.0, persistence mechanism is used to access the database in which container manages the

More information

Oracle Exam 1z0-809 Java SE 8 Programmer II Version: 6.0 [ Total Questions: 128 ]

Oracle Exam 1z0-809 Java SE 8 Programmer II Version: 6.0 [ Total Questions: 128 ] s@lm@n Oracle Exam 1z0-809 Java SE 8 Programmer II Version: 6.0 [ Total Questions: 128 ] Oracle 1z0-809 : Practice Test Question No : 1 Given: public final class IceCream { public void prepare() { public

More information

INTRODUCTION TO JDBC - Revised spring

INTRODUCTION TO JDBC - Revised spring INTRODUCTION TO JDBC - Revised spring 2004 - 1 What is JDBC? Java Database Connectivity (JDBC) is a package in the Java programming language and consists of several Java classes that deal with database

More information

Advanced Programming Techniques. Database Systems. Christopher Moretti

Advanced Programming Techniques. Database Systems. Christopher Moretti Advanced Programming Techniques Database Systems Christopher Moretti History Pre-digital libraries Organized by medium, size, shape, content, metadata Record managers (1800s-1950s) manually- indexed punched

More information

Chair of Software Engineering. Java and C# in Depth. Prof. Dr. Bertrand Meyer. Exercise Session 9. Nadia Polikarpova

Chair of Software Engineering. Java and C# in Depth. Prof. Dr. Bertrand Meyer. Exercise Session 9. Nadia Polikarpova Chair of Software Engineering Java and C# in Depth Prof. Dr. Bertrand Meyer Exercise Session 9 Nadia Polikarpova Quiz 1: scrolling a ResultSet (JDBC) How do you assess the following code snippet that iterates

More information

JDeveloper. Read Lotus Notes Data via URL Part 2

JDeveloper. Read Lotus Notes Data via URL Part 2 JDeveloper Read Lotus Notes Data via URL Part 2 Introduction: Read App Data from Lotus Notes Database into Java Server Faces Page on JDeveloper, running on Weblogic Server Use Existing Code HTTPCSVDataJavaAgent

More information

HR Database. Sample Output from TechWriter 2007 for Databases

HR Database. Sample Output from TechWriter 2007 for Databases Table of Contents...3 Tables... 4 COUNTRIES... 5 DEPARTMENTS... 6 EMPLOYEES... 7 JOBS... 9 JOB_HISTORY... 10 LOCATIONS...12 REGIONS...13 Views...14 EMP_DETAILS_VIEW... 15 Procedures...17 SECURE_DML...18

More information

LAMPIRAN. Lampiran 1 Source Code service a. Source Code koneksi. b. source code service user

LAMPIRAN. Lampiran 1 Source Code service a. Source Code koneksi. b. source code service user LAMPIRAN Lampiran 1 Source Code service a. Source Code koneksi. package goodjob.rest.service; java.sql.connection; java.sql.drivermanager; java.sql.resultset; java.sql.sqlexception; java.sql.statement;

More information

Introduction to Java Development with IDS

Introduction to Java Development with IDS Introduction to Java Development with IDS Jean Georges Perrin IIUG GreenIvory.com Tuesday, October 3 rd 2006 09:00 10:00. JGP.net Platform: IDS, Java 1 Agenda Who am I? Architecture Requirements Your very

More information

Advanced Programming Languages Effective Java Item 1. Spring 2015 Chungnam National Univ Eun-Sun Cho

Advanced Programming Languages Effective Java Item 1. Spring 2015 Chungnam National Univ Eun-Sun Cho Advanced Programming Languages Effective Java Item 1 Spring 2015 Chungnam National Univ Eun-Sun Cho 1 1. Introduction 2. Creating and Destroying Objects Item 1: Consider static factory methods instead

More information

EXISTS NOT EXISTS WITH

EXISTS NOT EXISTS WITH Subquery II. Objectives After completing this lesson, you should be able to do the following: Write a multiple-column subquery Use scalar subqueries in SQL Solve problems with correlated subqueries Update

More information

Prof. Edwar Saliba Júnior

Prof. Edwar Saliba Júnior 1 package Conexao; 2 3 4 * 5 * @author Cynthia Lopes 6 * @author Edwar Saliba Júnior 7 8 import java.io.filenotfoundexception; 9 import java.io.ioexception; 10 import java.sql.sqlexception; 11 import java.sql.statement;

More information

Distributed Systems Project 5 Assigned: Friday, April 6, 2012 Due: Friday, April 20, 11:59:59 PM

Distributed Systems Project 5 Assigned: Friday, April 6, 2012 Due: Friday, April 20, 11:59:59 PM 95-702 Distributed Systems Project 5 Assigned: Friday, April 6, 2012 Due: Friday, April 20, 11:59:59 PM Project Topics: Relational Databases, Local Transactions, Web Services, and Android This project

More information

Databases and MySQL. COMP 342: Programming Methods. 16 September Databases and MySQL

Databases and MySQL. COMP 342: Programming Methods. 16 September Databases and MySQL Databases and MySQL COMP 342: Programming Methods 16 September 2008 Databases and MySQL Database basics What is a database? A database consists of some number of tables. Each table consists of field names

More information

School of Computing and Information Technology Session: Spring CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018

School of Computing and Information Technology Session: Spring CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018 School of Computing and Information Technology Session: Spring 2018 University of Wollongong Lecturer: Janusz R. Getta CSCI835 Database Systems (Bridging Subject) Sample class test 23 July 2018 THE QUESTIONS

More information

Database Programming with SQL

Database Programming with SQL Database Programming with SQL 6-2 Objectives This lesson covers the following objectives: Construct and execute a join with the ANSI-99 USING Clause Construct and execute a join with the ANSI-99 ON Clause

More information

INTRODUCTION TO JDBC - Revised Spring

INTRODUCTION TO JDBC - Revised Spring INTRODUCTION TO JDBC - Revised Spring 2006 - 1 What is JDBC? Java Database Connectivity (JDBC) is an Application Programmers Interface (API) that defines how a Java program can connect and exchange data

More information

Beans and HTML Forms. Usually Beans are used to represent the data of HTML forms

Beans and HTML Forms. Usually Beans are used to represent the data of HTML forms Beans and HTML Forms Usually Beans are used to represent the data of HTML forms Example: Name Form jsp Processong form using a bean jsp Processing form using

More information

Brekeke PBX Version 3 IVR Developer s Guide Brekeke Software, Inc.

Brekeke PBX Version 3 IVR Developer s Guide Brekeke Software, Inc. Brekeke PBX Version 3 IVR Developer s Guide Brekeke Software, Inc. Version Brekeke PBX version 3 IVR Script Developer s Guide Copyright This document is copyrighted by Brekeke Software, Inc. Copyright

More information

Databases and SQL Lab EECS 448

Databases and SQL Lab EECS 448 Databases and SQL Lab EECS 448 Databases A database is an organized collection of data. Data facts are stored as fields. A set of fields that make up an entry in a table is called a record. Server - Database

More information