Java and Databases. COMP514 Distributed Information Systems. Java Database Connectivity. Standards and utilities. Java and Databases

Size: px
Start display at page:

Download "Java and Databases. COMP514 Distributed Information Systems. Java Database Connectivity. Standards and utilities. Java and Databases"

Transcription

1 Java and Databases COMP514 Distributed Information Systems Java Database Connectivity One of the problems in writing Java, C, C++,, applications is that the programming languages cannot provide persistence of data (at least on their own) Example: Java (and applets) can be used for developing simple graphical interfaces where an user can input data and retrieve other data. Unfortunately if we stop the Java application all that the data that user has provided are lost. Solution: Persistence is available by storing and accessing data held by a database management system. Java and Databases Standards and utilities Problem: how can my Java program access different kinds of databases? Java programs Relational Database Without standardized database interfaces, integrating diverse data would be extraordinarily difficult. Standardized interfaces include ODBC and JDBC. These interfaces provide drivers that act as intermediary between the application and the DBMS. The interfaces process our Java requests and submit SQL statements to a data source.

2 Java and Databases Database Access in Java - JDBC JDBC Java programs Relational Database JDBC provides: SQL access a driver manager Vendors provide drivers to plug into the managers: Oracle vendors will provide Oracle drivers MySQL vendors will provide MySQL drivers... The programmer (us) has to provide The location of the database The name of a Driver. These two things are provided in the form of a URL Building an Application Connecting to different databases The Driver Manager load an appropriate Driver The Connection is made Queries can then be executed as required Data is returned as objects that can be manipulated by the Java program All the methods that we will use to query/modify a database are the same, regardless of the type of database involved. IE. JDBC provides an homogeneous standard for accessing different kinds of databases But drivers are different. So, first we have to learn how to connect to different databases: Access Oracle

3 Specifying the Connection Specifying the Connection in Oracle We have to provide: The location of the database (URL) Driver name Oracle uses interfaces provided by the Oracle company. There are different kinds of interfaces for different usages. We will see the thin interface. A database URL has the following form jdbc:<subprotocol>:<subname> We need to know: the subprotocol. This enables the driver manager to identify the driver the subname. The subname can vary, depending on the driver. It usually includes information like the name of the database, the location of the database, the port used in the communication, your username and password, etc etc Java program Database connectivity thin Oracle database Specifying the Connection in Oracle Specifying the Connection in Oracle Using the thin driver, the syntax for the URL is jdbc:oracle:thin:@<data-source-name> So, assume I have created an Oracle database called c514. Can I connect to it? <data-source-name> is composed by: the name of the machine where the Oracle server runs; the port used by the JDBC connection; the name of the database schema we want to access In our case: jdbc:oracle:thin:@indian:1521:c514 jdbc:oracle:thin:@indian.csc.liv.ac.uk:1521:c514 No, first we have to tell the java compiler where the thin drivers and the appropriate Java libraries are. It depends, of course, on particular configuration of the system. See details on the next two slides for our particular setting

4 Specifying the Connection in Oracle On a linux machine 1) open your.profile file 2) Add (if it is not already there): # Oracle setup export ORACLE_BASE=/net/oracle/app/oracle export ORACLE_HOME=/net/oracle/app/oracle/product/8.1.7 export PATH=${PATH}:${ORACLE_HOME}/bin export SHLIB_PATH=${ORACLE_HOME}/lib export TWO_TASK=DVLP.csc.liv.ac.uk Specifying the Connection in Oracle # JDBC setup CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib/classes111.zip:$ORA CLE_HOME/jdbc/lib/nls_charset11.zip export CLASSPATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/jdbc/lib Log out and log in again Connecting to a database SQL Statement Execution in Java Assume that I have created a database called c512 (Access or Oracle, it doesn t matter) containing the following relations: Beers(name, brewery) Bars(name, addr, licence, barc#) Drinkers(name, gender) Likes (drinker, beer) Sells(beer, bar, price) Frequents(drinker, bar) How can I connect and query it with a Java program? Four steps corresponding to four primary classes from the java.sql package: load a driver (java.sql.drivermanager) connect to the DB (java.sql.connection) create a SQL statement (java.sql.statement) execute a SQL statement (java.sql.resultset)

5 An example The Java code (Oracle version) We want a Java program that executes the query: SELECT name FROM Bars WHERE licence = pub // You need to import the java.sql package to use JDBC import java.sql.*; class myfirstquery { public static void main (String args []) throws SQLException { // Load the ORACLE driver DriverManager.registerDriver(new oracle.jdbc.driver.oracledriver()); String url = "jdbc:oracle:thin:@indian:1521:c514"; String username = yourusername"; String password = yourpassword"; String query = "SELECT name FROM Bars WHERE license = pub " The Java code (Oracle version) The Java code explained // Connect to the database Connection conn = DriverManager.getConnection (url, username, password); // Create a Statement Statement SelectStatement = conn.createstatement (); // Execute the SQL statement ResultSet rset = SelectStatement.executeQuery (query); // Iterate through the result and print the bars names while (rset.next ()) System.out.println (rset.getstring (1)); }} // You need to import the java.sql package to use JDBC import java.sql.*; // Load the ODBC driver Class.forName(sun.jdbc.odbc.JdbcOdbcDriver); // Load the ORACLE driver DriverManager.registerDriver(new oracle.jdbc.driver.oracledriver()); java.sql is the package we have to use in order to access SQL databases. Load the appropriate driver.

6 The Java code explained The Java code explained String url = "jdbc:odbc:mydatabase"; String username = ""; String password = ""; String url = "jdbc:oracle:thin:@indian:1521:c302"; String username = yourusername"; String password = yourpassword"; // Connect to the database Connection conn = DriverManager.getConnection (url, username, password); // Create a Statement Statement SelectStatement = conn.createstatement (); Associate one (or more) statements with this connection; // Execute the SQL statement ResultSet rset = SelectStatement.executeQuery (query); Execute the statement(s); Connect to the database The Java code explained Another example // Iterate through the result and print the bars names while (rset.next ()) System.out.println (rset.getstring (1) ); rset contains the table which is the result of the query. This object contains a reference to the rows of this table. We can use.next() to processe all the rows in rset one by one. Also we can use methods like getstring to process the columns. getstring takes an int argument which represents the column number of the rset table. String query = "SELECT name, address FROM Bars WHERE licence = pub ; // Iterate through the result and print the bars names and addresses while (rset.next ()) System.out.println (rset.getstring (1) + rset.getstring (2) ); OR, if you want to add some extra information: // Iterate through the result and print the bars names and addresses while (rset.next ()) System.out.println (``Name: + rset.getstring (1) + ``Address: + rset.getstring (2) );

7 Another example ResultSet Class String query = "SELECT beer,price FROM Sells WHERE bar = The Polar Bar ; // Iterate through the result and print the beers names and prices while (rset.next ()) System.out.println ``Beer: + rset.getstring (1) + ``Price: + rset.getfloat (2) ); Since price is a Float we need the appropriate method!! next close wasnull getstring getboolean getbyte getshort getint getlong getfloat getdouble getnumeric getbytes getdate gettime gettimestamp getasciistream getunicodestream getbinarystream An example of updating: insert rows An example of updating: modify rows // Create a Statement Statement UpdateStatement = conn.createstatement (); //Create an update string String update = INSERT INTO Sells (bar, beer, price) + VALUES ( The Bar, Bud, 2.0) ; // Execute the SQL statement UpdateStatement.executeUpdate (update); Set the price of Stella to 2.30 in the table Sells The SQL statement is UPDATE Sells SET price = 2.30 WHERE beer = Stella Artois The only difference with the previous code is the use of the executeupdate method. Also we do not need to store any result set!!

8 An example of updating: modify rows Table creation The Java code: // Create a Statement Statement UpdateStatement = conn.createstatement (); //Create an update string String update = UPDATE Sells SET price = WHERE beer = Stella Artois ; // Execute the SQL statement UpdateStatement.executeUpdate (update); The last missing bit: Create and drop objects (tables, views ) Example: we want to create the table Sells SQL statement CREATE TABLE Sells( bar CHAR(20), beer VARCHAR(20), price REAL) Table creation Managing transactions with Java The Java code // Create a Statement Statement UpdateStatement = conn.createstatement (); //Create an update string String update = CREATE TABLE Sells(bar CHAR(20), + beer VARCHAR(20),price REAL) // Execute the SQL statement UpdateStatement.executeUpdate (update); Concurrent updates on the same database can generate problems. This is because by default different SQL statements contained in a Java program are considered different transactions. Consider the following code. This code provides a simple interface for booking seats in a cinema.

9 Managing transactions with Java Managing transactions with Java The database contains a table Cinema Screen Seats a 150 b 40 c 1 The code queries the database for seats in a given screen and book the seat if there is one. The query is executed and the result is put into rs: String query = "SELECT seats FROM Cinema WHERE screen = " + "'"+screenname+"'"; Statement stmt = conn.createstatement(); ResultSet rs = stmt.executequery(query); Managing transactions with Java Managing transactions with Java The number of seat is extracted from rs and assigned to seats: while(rs.next()) { seats = rs.getint(1); System.out.println (seats); } An if-block tests if there are still seats. If yes, a seat is booked and the database is updated. If no, a sorry message is printed. if (seats > 0){ System.out.println ("There are still seats available"); String update = "UPDATE CINEMA SET seats = seats - 1 WHERE screen = " + "'"+screenname+"'"; Statement updatestmt = conn.createstatement (); updatestmt.executeupdate(update); System.out.println ("seat booked"); } else {System.out.println ("There are no seats available. Sorry.");}

10 Managing transactions with Java The setautocommit mode What happens if two people try to book a seat in screen c at the same time? The query "SELECT seats FROM Cinema WHERE screen = " + "'"+screenname+"' will give answer 1 to both, and seats will be assigned to 1 in both cases. Therefore both people will receive (and pay) a ticket for only one seat. The problem in the previous example was due to the fact that the execution of the query, and the execution of the update generated two different transactions. Sometimes we need to group different SQL statements in a single transaction. That is we want that: either all of the statements are executed, or none of the statements is executed. We group statements using the setautocommint method. The setautocommit mode 2-Tier Server applications conn.setautocommit(false); SQL statements conn.commit(); conn.setautocommit(true); Java Application using JDBC interface network JDBC Enabled Database All the SQL statements after the setautocommit(false) are do not commit until a comit() method is used. This enables us to group SQL statements into a single transaction.

11 2-Tier Server applications 3-Tier Server This application architecture is simple, but.. often has to do all the processing has to know everything about the database where it is current access controls access permissions etc. Database has to be visible to the client Databases are not meant to handle large numbers of simultaneous invocations Assume that different clients want to access to the DB. Possibly asking the same queries. Sockets JavaIDL JavaRMI Server JDBC DB 3-Tier Server - advantages (Firewall) Server can manage database connections efficiently can focus on processing data retrieved Running server on high performance hardware can improve client perceived performance Database only has to be visible to the server - not the rest of the machines!! Can be hidden behind a firewall Operational changes only have to be notified to the server - not all the clients Much better security Firewall - a security gateway that protects an organization from unauthorized access via the Internet Consists of software and sometimes hardware components.

12 3-Tier Server - an example 3-Tier Server - an example Write a server that provides a remote method invocation for a method getgeneraltable(string tablename) The example is contained in: Query.java (the RMI interface) QueryImpl.java (the Server) Query.java (the ) Query Query Query JavaRMI Query QueryImpl JDBC DB 3-Tier Server - an example query does not need any knowledge of the database. Only the names of the tables (more in general the queries) that it wants to submit to the database.

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University

CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University CS 377 Database Systems SQL Programming Li Xiong Department of Mathematics and Computer Science Emory University 1 A SQL Query Joke A SQL query walks into a bar and sees two tables. He walks up to them

More information

JDBC (Java / SQL Programming) CS 377: Database Systems

JDBC (Java / SQL Programming) CS 377: Database Systems JDBC (Java / SQL Programming) CS 377: Database Systems JDBC Acronym for Java Database Connection Provides capability to access a database server through a set of library functions Set of library functions

More information

SQL and Java. Database Systems Lecture 19 Natasha Alechina

SQL and Java. Database Systems Lecture 19 Natasha Alechina Database Systems Lecture 19 Natasha Alechina In this Lecture SQL in Java SQL from within other Languages SQL, Java, and JDBC For More Information Sun Java tutorial: http://java.sun.com/docs/books/tutorial/jdbc

More information

JDBC. It is connected by the Native Module of dependent form of h/w like.dll or.so. ex) OCI driver for local connection to Oracle

JDBC. It is connected by the Native Module of dependent form of h/w like.dll or.so. ex) OCI driver for local connection to Oracle JDBC 4 types of JDBC drivers Type 1 : JDBC-ODBC bridge It is used for local connection. ex) 32bit ODBC in windows Type 2 : Native API connection driver It is connected by the Native Module of dependent

More information

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC?

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC? What is ODBC? Database Connectivity ODBC, JDBC and SQLJ CS2312 ODBC is (Open Database Connectivity): A standard or open application programming interface (API) for accessing a database. SQL Access Group,

More information

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford Database Programming Week 10-2 *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford SQL in Real Programs We have seen only how SQL is used at the generic query

More information

COSC344 Database Theory and Applications. Java and SQL. Lecture 12

COSC344 Database Theory and Applications. Java and SQL. Lecture 12 COSC344 Database Theory and Applications Lecture 12: Java and SQL COSC344 Lecture 12 1 Last Lecture Trigger Overview This Lecture Java & SQL Source: Lecture notes, Textbook: Chapter 12 JDBC documentation

More information

Why Is This Important? Database Application Development. SQL in Application Code. Overview. SQL in Application Code (Contd.

Why Is This Important? Database Application Development. SQL in Application Code. Overview. SQL in Application Code (Contd. Why Is This Important? Database Application Development Chapter 6 So far, accessed DBMS directly through client tools Great for interactive use How can we access the DBMS from a program? Need an interface

More information

Chapter 9 Java and SQL. Wang Yang [email protected]

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn Chapter 9 Java and SQL Wang Yang [email protected] 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

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language: Database Access from a Programming Language Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

Database Access from a Programming Language:

Database Access from a Programming Language: Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang Supplement IV.C: Tutorial for Oracle For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Connecting and Using Oracle Creating User Accounts Accessing Oracle

More information

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang Supplement IV.D: Tutorial for MS Access For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Creating Databases and Executing SQL Creating ODBC Data Source

More information

Making Oracle and JDBC Work For You

Making Oracle and JDBC Work For You Making Oracle and JDBC Work For You Presented to: TOUG DBA/Developer Day 2004 October 25, 2004 John Jay King King Training Resources [email protected] Download this paper and code examples from: http://www.kingtraining.com

More information

CS/CE 2336 Computer Science II

CS/CE 2336 Computer Science II CS/CE 2336 Computer Science II UT D Session 23 Database Programming with Java Adapted from D. Liang s Introduction to Java Programming, 8 th Ed. and other sources 2 Database Recap Application Users Application

More information

Real SQL Programming 1

Real SQL Programming 1 Real 1 We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs

More information

Abstract. Introduction. Web Technology and Thin Clients. What s New in Java Version 1.1

Abstract. Introduction. Web Technology and Thin Clients. What s New in Java Version 1.1 Overview of Java Components and Applets in SAS/IntrNet Software Barbara Walters, SAS Institute Inc., Cary, NC Don Chapman, SAS Institute Inc., Cary, NC Abstract This paper describes the Java components

More information

DEVELOPING MULTITHREADED DATABASE APPLICATION USING JAVA TOOLS AND ORACLE DATABASE MANAGEMENT SYSTEM IN INTRANET ENVIRONMENT

DEVELOPING MULTITHREADED DATABASE APPLICATION USING JAVA TOOLS AND ORACLE DATABASE MANAGEMENT SYSTEM IN INTRANET ENVIRONMENT DEVELOPING MULTITHREADED DATABASE APPLICATION USING JAVA TOOLS AND ORACLE DATABASE MANAGEMENT SYSTEM IN INTRANET ENVIRONMENT Raied Salman Computer Information Science, American College of Commerce and

More information

FileMaker 11. ODBC and JDBC Guide

FileMaker 11. ODBC and JDBC Guide FileMaker 11 ODBC and JDBC Guide 2004 2010 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker is a trademark of FileMaker, Inc. registered

More information

Database Design and Programming

Database Design and Programming Database Design and Programming Peter Schneider-Kamp DM 505, Spring 2012, 3 rd Quarter 1 Course Organisation Literature Database Systems: The Complete Book Evaluation Project and 1-day take-home exam,

More information

How To Use A Sas Server On A Java Computer Or A Java.Net Computer (Sas) On A Microsoft Microsoft Server (Sasa) On An Ipo (Sauge) Or A Microsas (Sask

How To Use A Sas Server On A Java Computer Or A Java.Net Computer (Sas) On A Microsoft Microsoft Server (Sasa) On An Ipo (Sauge) Or A Microsas (Sask Exploiting SAS Software Using Java Technology Barbara Walters, SAS Institute Inc., Cary, NC Abstract This paper describes how to use Java technology with SAS software. SAS Institute currently offers several

More information

Java DataBase Connectivity (JDBC)

Java DataBase Connectivity (JDBC) Java DataBase Connectivity (JDBC) Plan Presentation of JDBC JDBC Drivers Work with JDBC Interfaces and JDBC classes Exceptions SQL requests Transactions and exceptions 1 Presentation JDBC (Java Data Base

More information

Part IV: Java Database Programming

Part IV: Java Database Programming Part IV: Java Database Programming This part of the book discusses how to use Java to develop database projects. You will learn JDBC interfaces and classes, create and process SQL statements, obtaining

More information

Using Netbeans and the Derby Database for Projects Contents

Using Netbeans and the Derby Database for Projects Contents Using Netbeans and the Derby Database for Projects Contents 1. Prerequisites 2. Creating a Derby Database in Netbeans a. Accessing services b. Creating a database c. Making a connection d. Creating tables

More information

FileMaker 13. ODBC and JDBC Guide

FileMaker 13. ODBC and JDBC Guide FileMaker 13 ODBC and JDBC Guide 2004 2013 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker, Inc.

More information

FileMaker 12. ODBC and JDBC Guide

FileMaker 12. ODBC and JDBC Guide FileMaker 12 ODBC and JDBC Guide 2004 2012 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks of FileMaker, Inc.

More information

CS2506 Operating Systems II Lab 8, 8 th Tue/03 /2011 Java API

CS2506 Operating Systems II Lab 8, 8 th Tue/03 /2011 Java API Introduction The JDBC API was designed to keep simple things simple. This means that the JDBC makes everyday database tasks easy. In this lab you will learn about how Java interacts with databases. JDBC

More information

How To Use The Database In Jdbc.Com On A Microsoft Gdbdns.Com (Amd64) On A Pcode (Amd32) On An Ubuntu 8.2.2 (Amd66) On Microsoft

How To Use The Database In Jdbc.Com On A Microsoft Gdbdns.Com (Amd64) On A Pcode (Amd32) On An Ubuntu 8.2.2 (Amd66) On Microsoft CS 7700 Transaction Design for Microsoft Access Database with JDBC Purpose The purpose of this tutorial is to introduce the process of developing transactions for a Microsoft Access Database with Java

More information

Applets, RMI, JDBC Exam Review

Applets, RMI, JDBC Exam Review Applets, RMI, JDBC Exam Review Sara Sprenkle Announcements Quiz today Project 2 due tomorrow Exam on Thursday Web programming CPM and servlets vs JSPs Sara Sprenkle - CISC370 2 1 Division of Labor Java

More information

Querying Databases Using the DB Query and JDBC Query Nodes

Querying Databases Using the DB Query and JDBC Query Nodes Querying Databases Using the DB Query and JDBC Query Nodes Lavastorm Desktop Professional supports acquiring data from a variety of databases including SQL Server, Oracle, Teradata, MS Access and MySQL.

More information

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches

Course Objectives. Database Applications. External applications. Course Objectives Interfacing. Mixing two worlds. Two approaches Course Objectives Database Applications Design Construction SQL/PSM Embedded SQL JDBC Applications Usage Course Objectives Interfacing When the course is through, you should Know how to connect to and

More information

CS346: Database Programming. http://warwick.ac.uk/cs346

CS346: Database Programming. http://warwick.ac.uk/cs346 CS346: Database Programming http://warwick.ac.uk/cs346 1 Database programming Issue: inclusionofdatabasestatementsinaprogram combination host language (general-purpose programming language, e.g. Java)

More information

CHAPTER 3. Relational Database Management System: Oracle. 3.1 COMPANY Database

CHAPTER 3. Relational Database Management System: Oracle. 3.1 COMPANY Database 45 CHAPTER 3 Relational Database Management System: Oracle This chapter introduces the student to the basic utilities used to interact with Oracle DBMS. The chapter also introduces the student to programming

More information

FileMaker 14. ODBC and JDBC Guide

FileMaker 14. ODBC and JDBC Guide FileMaker 14 ODBC and JDBC Guide 2004 2015 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and FileMaker Go are trademarks of FileMaker,

More information

1 SQL Data Types and Schemas

1 SQL Data Types and Schemas COMP 378 Database Systems Notes for Chapters 4 and 5 of Database System Concepts Advanced SQL 1 SQL Data Types and Schemas 1.1 Additional Data Types 1.1.1 User Defined Types Idea: in some situations, data

More information

The JAVA Way: JDBC and SQLJ

The JAVA Way: JDBC and SQLJ The JAVA Way: JDBC and SQLJ David Toman School of Computer Science University of Waterloo Introduction to Databases CS348 David Toman (University of Waterloo) JDBC/SQLJ 1 / 21 The JAVA way to Access RDBMS

More information

Porting from Oracle to PostgreSQL

Porting from Oracle to PostgreSQL by Paulo Merson February/2002 Porting from Oracle to If you are starting to use or you will migrate from Oracle database server, I hope this document helps. If you have Java applications and use JDBC,

More information

Working With Derby. Version 10.2 Derby Document build: December 11, 2006, 7:06:09 AM (PST)

Working With Derby. Version 10.2 Derby Document build: December 11, 2006, 7:06:09 AM (PST) Working With Derby Version 10.2 Derby Document build: December 11, 2006, 7:06:09 AM (PST) Contents Copyright...3 Introduction and prerequisites...4 Activity overview... 5 Activity 1: Run SQL using the

More information

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today. & & 1 & 2 Lecture #7 2008 3 Terminology Structure & & Database server software referred to as Database Management Systems (DBMS) Database schemas describe database structure Data ordered in tables, rows

More information

Database Application Development. Overview. SQL in Application Code. Chapter 6

Database Application Development. Overview. SQL in Application Code. Chapter 6 Database Application Development Chapter 6 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Overview Concepts covered in this lecture: SQL in application code Embedded SQL Cursors Dynamic

More information

SQL and programming languages

SQL and programming languages SQL and programming languages SET08104 Database Systems Copyright Napier University Slide 1/14 Pure SQL Pure SQL: Queries typed at an SQL prompt. SQL is a non-procedural language. SQL specifies WHAT, not

More information

Apéndice C: Código Fuente del Programa DBConnection.java

Apéndice C: Código Fuente del Programa DBConnection.java Apéndice C: Código Fuente del Programa DBConnection.java import java.sql.*; import java.io.*; import java.*; import java.util.*; import java.net.*; public class DBConnection Connection pgsqlconn = null;

More information

Overview. Database Application Development. SQL in Application Code (Contd.) SQL in Application Code. Embedded SQL. Embedded SQL: Variables

Overview. Database Application Development. SQL in Application Code (Contd.) SQL in Application Code. Embedded SQL. Embedded SQL: Variables Overview Database Application Development Chapter 6 Concepts covered in this lecture: SQL in application code Embedded SQL Cursors Dynamic SQL JDBC SQLJ Stored procedures Database Management Systems 3ed,

More information

LSINF1124 Projet de programmation

LSINF1124 Projet de programmation LSINF1124 Projet de programmation Database Programming with Java TM Sébastien Combéfis University of Louvain (UCLouvain) Louvain School of Engineering (EPL) March 1, 2011 Introduction A database is a collection

More information

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

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute JMP provides a variety of mechanisms for interfacing to other products and getting data into JMP. The connection

More information

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

Microsoft SQL Server Features that can be used with the IBM i that can be used with the IBM i Gateway/400 User Group February 9, 2012 Craig Pelkie [email protected] Copyright 2012, Craig Pelkie ALL RIGHTS RESERVED What is Microsoft SQL Server? Windows database management

More information

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI SaaS Hosting Automation is a JAVA SaaS Enablement infrastructure that enables web hosting services

More information

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse

How To Let A Lecturer Know If Someone Is At A Lecture Or If They Are At A Guesthouse Saya WebServer Mini-project report Introduction: The Saya WebServer mini-project is a multipurpose one. One use of it is when a lecturer (of the cs faculty) is at the reception desk and interested in knowing

More information

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications

Chapter 13. Introduction to SQL Programming Techniques. Database Programming: Techniques and Issues. SQL Programming. Database applications Chapter 13 SQL Programming Introduction to SQL Programming Techniques Database applications Host language Java, C/C++/C#, COBOL, or some other programming language Data sublanguage SQL SQL standards Continually

More information

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860 Java DB Performance Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860 AGENDA > Java DB introduction > Configuring Java DB for performance > Programming tips > Understanding Java DB performance

More information

Database System Concepts

Database System Concepts Chapter 8(+4): Application Design and Development APIs Web Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do

More information

Brazil + JDBC Juin 2001, [email protected] http://jfod.cnam.fr/tp_cdi/douin/

Brazil + JDBC Juin 2001, douin@cnam.fr http://jfod.cnam.fr/tp_cdi/douin/ Brazil + JDBC Juin 2001, [email protected] http://jfod.cnam.fr/tp_cdi/douin/ version du 26 Mai 2003 : JDBC-SQL et Brazil pré-requis : lecture de Tutorial JDBC de Sun Bibliographie Brazil [Bra00]www.sun.com/research/brazil

More information

Accesssing External Databases From ILE RPG (with help from Java)

Accesssing External Databases From ILE RPG (with help from Java) Accesssing External Databases From ILE RPG (with help from Java) Presented by Scott Klement http://www.scottklement.com 2008-2015, Scott Klement There are 10 types of people in the world. Those who understand

More information

TG Web. Technical FAQ

TG Web. Technical FAQ TG Web Technical FAQ About this FAQ We encourage you to contact us if. You can't find the information you're looking for. You would like to discuss your specific testing requirements in more detail. You

More information

ODBC Client Driver Help. 2015 Kepware, Inc.

ODBC Client Driver Help. 2015 Kepware, Inc. 2015 Kepware, Inc. 2 Table of Contents Table of Contents 2 4 Overview 4 External Dependencies 4 Driver Setup 5 Data Source Settings 5 Data Source Setup 6 Data Source Access Methods 13 Fixed Table 14 Table

More information

Package sjdbc. R topics documented: February 20, 2015

Package sjdbc. R topics documented: February 20, 2015 Package sjdbc February 20, 2015 Version 1.5.0-71 Title JDBC Driver Interface Author TIBCO Software Inc. Maintainer Stephen Kaluzny Provides a database-independent JDBC interface. License

More information

2. Follow the installation directions and install the server on ccc

2. Follow the installation directions and install the server on ccc Installing a Web Server 1. Install a sample web server, which supports Servlets/JSPs. A light weight web server is Apache Tomcat server. You can get the server from http://tomcat.apache.org/ 2. Follow

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

How I hacked PacketStorm (1988-2000)

How I hacked PacketStorm (1988-2000) Outline Recap Secure Programming Lecture 8++: SQL Injection David Aspinall, Informatics @ Edinburgh 13th February 2014 Overview Some past attacks Reminder: basics Classification Injection route and motive

More information

Configuring Apache Derby for Performance and Durability Olav Sandstå

Configuring Apache Derby for Performance and Durability Olav Sandstå Configuring Apache Derby for Performance and Durability Olav Sandstå Sun Microsystems Trondheim, Norway Agenda Apache Derby introduction Performance and durability Performance tips Open source database

More information

Security Module: SQL Injection

Security Module: SQL Injection Security Module: SQL Injection Description SQL injection is a security issue that involves inserting malicious code into requests made to a database. The security vulnerability occurs when user provided

More information

Oracle Data Integrator integration with OBIEE

Oracle Data Integrator integration with OBIEE Oracle Data Integrator integration with OBIEE February 26, 2010 1:20 2:00 PM Presented By Phani Kottapalli [email protected] 1 Agenda Introduction to ODI Architecture Installation Repository

More information

Self-test Database application programming with JDBC

Self-test Database application programming with JDBC Self-test Database application programming with JDBC Document: e1216test.fm 18/04/2012 ABIS Training & Consulting P.O. Box 220 B-3000 Leuven Belgium TRAINING & CONSULTING INTRODUCTION TO THE SELF-TEST

More information

STREAMEZZO RICH MEDIA SERVER

STREAMEZZO RICH MEDIA SERVER STREAMEZZO RICH MEDIA SERVER Clustering This document is the property of Streamezzo. It cannot be distributed without the authorization of Streamezzo. Table of contents 1. INTRODUCTION... 3 1.1 Rich Media

More information

Evaluation. Copy. Evaluation Copy. Chapter 7: Using JDBC with Spring. 1) A Simpler Approach... 7-2. 2) The JdbcTemplate. Class...

Evaluation. Copy. Evaluation Copy. Chapter 7: Using JDBC with Spring. 1) A Simpler Approach... 7-2. 2) The JdbcTemplate. Class... Chapter 7: Using JDBC with Spring 1) A Simpler Approach... 7-2 2) The JdbcTemplate Class... 7-3 3) Exception Translation... 7-7 4) Updating with the JdbcTemplate... 7-9 5) Queries Using the JdbcTemplate...

More information

Developing SQL and PL/SQL with JDeveloper

Developing SQL and PL/SQL with JDeveloper Seite 1 von 23 Developing SQL and PL/SQL with JDeveloper Oracle JDeveloper 10g Preview Technologies used: SQL, PL/SQL An Oracle JDeveloper Tutorial September 2003 Content This tutorial walks through the

More information

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO:

INTRODUCTION: SQL SERVER ACCESS / LOGIN ACCOUNT INFO: INTRODUCTION: You can extract data (i.e. the total cost report) directly from the Truck Tracker SQL Server database by using a 3 rd party data tools such as Excel or Crystal Reports. Basically any software

More information

A Generic Database Web Service

A Generic Database Web Service A Generic Database Web Service Erdogan Dogdu TOBB Economics and Technology University Computer Engineering Department Ankara, Turkey [email protected] Yanchao Wang and Swetha Desetty Georgia State University

More information

SQL and Programming Languages. SQL in Programming Languages. Applications. Approaches

SQL and Programming Languages. SQL in Programming Languages. Applications. Approaches SQL and Programming Languages SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.4 of Garcia-Molina The user does not want to execute SQL

More information

Apache Derby Security. Jean T. Anderson [email protected] [email protected]

Apache Derby Security. Jean T. Anderson jta@bristowhill.com jta@apache.org Apache Derby Security Jean T. Anderson [email protected] [email protected] Agenda Goals Understand how to take advantage of Apache Derby security features with a focus on the simplest options and configurations

More information

Web-based Automobile Sales Management System. Huabo Xiao

Web-based Automobile Sales Management System. Huabo Xiao 3rd International Conference on Management, Education, Information and Control (MEICI 2015) Web-based Automobile Sales Management System Huabo Xiao College of Information Engineering, Jiangxi University

More information

HP OO 10.X - SiteScope Monitoring Templates

HP OO 10.X - SiteScope Monitoring Templates HP OO Community Guides HP OO 10.X - SiteScope Monitoring Templates As with any application continuous automated monitoring is key. Monitoring is important in order to quickly identify potential issues,

More information

Configuring an Alternative Database for SAS Web Infrastructure Platform Services

Configuring an Alternative Database for SAS Web Infrastructure Platform Services Configuration Guide Configuring an Alternative Database for SAS Web Infrastructure Platform Services By default, SAS Web Infrastructure Platform Services is configured to use SAS Framework Data Server.

More information

TABLE OF CONTENTS...2 INTRODUCTION...3 APPLETS AND APPLICATIONS...3 JAVABEANS...4 EXCEPTION HANDLING...5 JAVA DATABASE CONNECTIVITY (JDBC)...

TABLE OF CONTENTS...2 INTRODUCTION...3 APPLETS AND APPLICATIONS...3 JAVABEANS...4 EXCEPTION HANDLING...5 JAVA DATABASE CONNECTIVITY (JDBC)... Advanced Features Trenton Computer Festival May 1 sstt & 2 n d,, 2004 Michael P.. Redlich Senior Research Technician ExxonMobil Research & Engineering [email protected] Table of Contents

More information

Using the SQL TAS v4

Using the SQL TAS v4 Using the SQL TAS v4 Authenticating to the server Consider this MySQL database running on 10.77.0.5 (standard port 3306) with username root and password mypassword. mysql> use BAKERY; Database changed

More information

Database Access Through Java Technologies

Database Access Through Java Technologies Database Systems Journal vol. 1, no. 1/2010 9 Database Access Through Java Technologies Ion LUNGU, Nicolae MERCIOIU Faculty of Cybernetics, Statistics and Economic Informatics, Academy of Economic Studies,

More information

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC MyOra 3.0 SQL Tool for Oracle User Guide Jayam Systems, LLC Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL

More information

Application Development A Cocktail of Java and MCP. MCP Guru Series Dan Meyer & Pramod Nair

Application Development A Cocktail of Java and MCP. MCP Guru Series Dan Meyer & Pramod Nair Application Development A Cocktail of Java and MCP MCP Guru Series Dan Meyer & Pramod Nair Agenda Which of the following topics can be found in an Application Development cocktail? o Calling Java from

More information

Tutorial for Spring DAO with JDBC

Tutorial for Spring DAO with JDBC Overview Tutorial for Spring DAO with JDBC Prepared by: Nigusse Duguma This tutorial demonstrates how to work with data access objects in the spring framework. It implements the Spring Data Access Object

More information

HP Vertica Integration with SAP Business Objects: Tips and Techniques. HP Vertica Analytic Database

HP Vertica Integration with SAP Business Objects: Tips and Techniques. HP Vertica Analytic Database HP Vertica Integration with SAP Business Objects: Tips and Techniques HP Vertica Analytic Database HP Big Data Document Release Date: June 23, 2015 Legal Notices Warranty The only warranties for HP products

More information

Setting up SQL Translation Framework OBE for Database 12cR1

Setting up SQL Translation Framework OBE for Database 12cR1 Setting up SQL Translation Framework OBE for Database 12cR1 Overview Purpose This tutorial shows you how to use have an environment ready to demo the new Oracle Database 12c feature, SQL Translation Framework,

More information

Building Java Servlets with Oracle JDeveloper

Building Java Servlets with Oracle JDeveloper Building Java Servlets with Oracle JDeveloper Chris Schalk Oracle Corporation Introduction Developers today face a formidable task. They need to create large, distributed business applications. The actual

More information

CSCI110 Exercise 4: Database - MySQL

CSCI110 Exercise 4: Database - MySQL CSCI110 Exercise 4: Database - MySQL The exercise This exercise is to be completed in the laboratory and your completed work is to be shown to the laboratory tutor. The work should be done in week-8 but

More information

1 File Processing Systems

1 File Processing Systems COMP 378 Database Systems Notes for Chapter 1 of Database System Concepts Introduction A database management system (DBMS) is a collection of data and an integrated set of programs that access that data.

More information

MySQL for Beginners Ed 3

MySQL for Beginners Ed 3 Oracle University Contact Us: 1.800.529.0165 MySQL for Beginners Ed 3 Duration: 4 Days What you will learn The MySQL for Beginners course helps you learn about the world's most popular open source database.

More information

Using IRDB in a Dot Net Project

Using IRDB in a Dot Net Project Note: In this document we will be using the term IRDB as a short alias for InMemory.Net. Using IRDB in a Dot Net Project ODBC Driver A 32-bit odbc driver is installed as part of the server installation.

More information

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later Copyright 2014, Lucid Innovations Limited. All Rights Reserved Lucid Research

More information

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

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later Copyright 2014, Lucid Innovations Limited. All Rights Reserved Lucid Research

More information

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0 HP NonStop JDBC Type 4 Driver November 22, 2004 Author: Ken Sell 1 Introduction Java applications and application environments continue to play an important role in software system development. Database

More information

Prof. Edwar Saliba Júnior

Prof. Edwar Saliba Júnior 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

More information

Install guide for Websphere 7.0

Install guide for Websphere 7.0 DOCUMENTATION Install guide for Websphere 7.0 Jahia EE v6.6.1.0 Jahia s next-generation, open source CMS stems from a widely acknowledged vision of enterprise application convergence web, document, search,

More information

LOCKSS on LINUX. CentOS6 Installation Manual 08/22/2013

LOCKSS on LINUX. CentOS6 Installation Manual 08/22/2013 LOCKSS on LINUX CentOS6 Installation Manual 08/22/2013 1 Table of Contents Overview... 3 LOCKSS Hardware... 5 Installation Checklist... 6 BIOS Settings... 9 Installation... 10 Firewall Configuration...

More information

Accessing a Microsoft SQL Server Database from SAS on Microsoft Windows

Accessing a Microsoft SQL Server Database from SAS on Microsoft Windows Accessing a Microsoft SQL Server Database from SAS on Microsoft Windows On Microsoft Windows, you have two options to access a Microsoft SQL Server database from SAS. You can use either SAS/Access Interface

More information