Creating Data Access Services Presented by Ashraf Memon Presented by Ashraf Memon.

Slides:



Advertisements
Similar presentations
A1.1 Assignment 1 “Deploying a Simple Web Service”
Advertisements

15-Jun-15 JDBC. JDBC is a Sun trademark It is often taken to stand for Java Database Connectivity Java is very standardized, but there are many versions.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
JDBC Overview Autumn 2001 Lecturer: C. DeJong. Relational Databases widespread use used via SQL (Structured Query Language) freely available powerful.
Advanced Java Programming – Eran Toch Methodologies in Information System Development Tutorial: Advanced Java Programming and Database connection Eran.
1 Lecture 29 More on JDBC Overview  Objectives of this lecture  JDBC and its Drivers  Connecting to Databases (Java’s Connection class)  Querying a.
Murali Mani Web Interface. Murali Mani Options PHP with mySQL JSP/Servlets with JDBC on mySQL/Oracle Others …
Creating File Access Services Presented by Ashraf Memon Presented by Ashraf Memon.
1 Introduction to Java Development with IDS Jean Georges Perrin IIUG GreenIvory.com JGP.net Tuesday, October 3 rd :00 – 10:00. Platform: IDS, Java.
Java Database Connectivity (JDBC) Francisco Pajaro Saul Acosta Nahum Quezada Manuel Rubio.
Java Database Connectivity (JDBC). Introduction Database –Collection of data DBMS –Database management system –Storing and organizing data SQL –Relational.
1 Java Database Connection (JDBC) There are many industrial-strength DBMS's commercially available in the market. Oracle, DB2, and Sybase are just a few.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
Views, Indexes and JDBC/JSP tutorial Professor: Dr. Shu-Ching Chen TA: Haiman Tian 1.
CSE 305 Theory of Database Tutorial on Connecting with Sybase from Java program and Developing GUI Jalal Mahmud, TA, CSE 305.
Examples of Using Servlets and JSP Representation and Management of Data on the Internet.
Introduction to Java Development with IDS Jean Georges Perrin IIUG I04 Tuesday, October 3 rd :00 – 10:00. Platform: IDS, Java.
Working With Apache Axis. Axis Information See guide.html for the basic user guide.
1 Creating File Access Services Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_JDBC_MySQL 1 MySQL and JDBC.
JAVA Database Access. JDBC The Java Database Connectivity (JDBC) API is the industry standard for database- independent connectivity between the Java.
JDBC Java and Databases, including Postgress. JDBC l Developed by Industry leaders l Three main goals: –JDBC should be an SQL-level API –JDBC should capitalize.
 What software components are required?  How do I install the Oracle JDBC driver?  How do I connect to the database?  What form is the data in and.
Index and JDBC/JSP tutorial Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
COMP201 Java Programming Topic 15: Database Connectivity JDBC Reading: Chapter 4, Volume 2.
JDBC Tutorial CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
1 Creating Web Services from a existing tool Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
1 Creating Web Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
Java, JDBC, Perl, CGI Embedded SQL November 3 rd, 2000.
COMP 321 Week 4. Overview Normalization Entity-Relationship Diagrams SQL JDBC/JDBC Drivers hsqldb Lab 4-1 Introduction.
EXAMPLE I An application showing JDBC access to Cloudscape.
DataBases and SQL INFSY 547 Spring Course Wrap Up April 12: Complete Work on Servlets Review of Team Projects Close of Portfolio Work April 19:
16 Java Database Connectivity. 2 Understand the JDBC Understand the steps of the JDBC: 1.) Importing packages 2.) Opening a connection to a database 3.)
Database Access Using JDBC BCIS 3680 Enterprise Programming.
Tasks Needed for MissionMapEditor Martin Q. Zhao September 18, 2010.
Access Databases from Java Programs via JDBC Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale
1 Creating Data Access Services Presented by Ashraf Memon Hands-on Ghulam Memon, Longjiang Ding.
Creating Web Services Presented by Ashraf Memon Presented by Ashraf Memon.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 8: Applications Programming for Relational Databases Instructor’s.
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
Intro to JDBC Joseph Sant Applied Computing and Engineering Sciences Sheridan ITAL.
6-1 JAVA DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Settings MySQL Database and JDBC configuration Instructor: Sergey Goldman.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_Oracle10g_JDBC 1 Application Development (JDBC)
Java and database. 3 Relational Databases A relational Database consists of a set of simple rectangular tables or relations The column headings are.
JDBC.
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
JSP and DB.
CS3220 Web and Internet Programming Database Access with JDBC
Java Access to RDB Relational databases (RDBs) dominate today, due to:
JDBC 15-Apr-18.
CS320 Web and Internet Programming Database Access with JDBC
JDBC 21-Aug-18.
HW#4 Making Simple BBS Using JDBC
Prof: Dr. Shu-Ching Chen TA: Sheng Guan
Client Access, Queries, Stored Procedures, JDBC
JDBC 15-Nov-18.
Mr. Harish Sharma Asst. Professor Dept. of CA & IT SGRRITS Dehradun
Interacting with Database
JDBC – ODBC DRIVERS.
MSIS 655 Advanced Business Applications Programming
Bolat Azamat, Kim Dongmin
Using a Database with JDBC
JAVA DATABaSE CONNECTIVITY
CS3220 Web and Internet Programming Database Access with JDBC
CS3220 Web and Internet Programming Database Access with JDBC
Presentation transcript:

Creating Data Access Services Presented by Ashraf Memon Presented by Ashraf Memon

2 Overview Writing data access service classes in Java Generating service Deploying services with Apache Axis Generating client files and testing them

3 Writing data access service classes in Java Data Access Services in Java heavily depend on JDBC JDBC stands for Java Database Connectivity and is a industry standard Java API from Sun for talking to any database - depending on availability of database driver.

4 Writing data access service classes in Java

5 Sample Data Access class contains 1 function, which reads coordinate data from summer_institute database and generates XML for it. Method signature is –public String parse(int criteria) Complete class code follows

6 Writing Data Acess service classes in Java (contd) import java.io.IOException; import java.sql.SQLException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import java.sql.ResultSet; public class DBAccess { public DBAccess() { }

7 Writing Data Acess service classes in Java (contd) public String parse(int criteria) throws IOException, SQLException, ClassNotFoundException { String xml = " \r\n\t"; Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection( "jdbc:mysql://geon07.sdsc.edu:3306/summer_institute", "root", ""); Statement stmt = connection.createStatement();

8 Writing Data Acess service classes in Java (contd) String sql = "SELECT * FROM earthquake WHERE magnitude > " + Integer.toString(criteria); ResultSet record = stmt.executeQuery(sql); while (record.next()) { xml += " \r\n\t\t"; xml += " " + record.getString("longitude") + " \r\n\t\t"; xml += " " + record.getString("latitude") + " \r\n\t\t"; xml += " " + record.getString("magnitude") + " \r\n\t"; xml += " \r\n\t"; }

9 Writing Data Acess service classes in Java (contd) xml += "\r\n"; xml += " "; return xml; }

10 Generating Service Download DBAccessService directory from ftp://dotnet.sdsc.edu/CSIG-WS/ ftp://dotnet.sdsc.edu/CSIG-WS/ Save directory to C:\training\user\code Compile DBAccess.java file by typing following at command prompt javac DBAccess.java Run program by typing following at command prompt java DBAccess

11 Generating Service (contd) Output should be E-02

12 Deploying services with Apache Axis Copy generated class file to C:\training\tools\tomcat\webapps\axis\WEB -INF\classes\ Open deployDBAccess.wsdd in Textpad (Explanation by instructor) Close file.

13 Deploying services with Apache Axis(contd) Set classpath by typing classpath at command prompt Execute deployment descriptor by typing deploy deployDBAccess.wsdd at command prompt. This deploys webservice on Axis SOAP Server.

14 Generating client files and testing them(contd) Compile DBAccessServiceClient.java by typing following at command prompt –javac DBAccess ServiceClient.java Execute Client by typing following at command prompt –java DBAccess ServiceClient Output should be sinilar to execution of DBAccess