Tasks Needed for MissionMapEditor Martin Q. Zhao September 18, 2010.

Slides:



Advertisements
Similar presentations
CE203 - Application Programming Autumn 2013CE203 Part 51 Part 5.
Advertisements

19 augustus 2003augustus 2003 JSP-2. BICT 2JDBC BICT 3Install MySQL Download MySQL daemon – Free – Windows version… Start Daemon – Mysqld-nt.exe Download.
JDBC. Java Database Connectivity (JDBC) Use the java.sql package to query and update the database. JDBC is an API that allows java to communicate with.
Distributed Application Development B. Ramamurthy.
Fundamentals, Design, and Implementation, 9/e Chapter 14 JDBC, Java Server Pages, and MySQL.
1 JDBC Java Database Connectivity. 2 c.pdf
1 Lecture 05: Database Programming (JDBC). 2 Outline JDBC overview JDBC API Reading: Chapter 10.5 Pointbase Developer Manual.
JDBC by Jon Pearce. DBase Concepts Terms Table Row/Entity Column/Field/Attribute Key/Primary Key/Foreign Key.
JDBC Overview Autumn 2001 Lecturer: C. DeJong. Relational Databases widespread use used via SQL (Structured Query Language) freely available powerful.
Java Database Connectivity (JDBC) java.sql package to query and update the database. JDBC is an API that allows java to communicate with a database server.
Object-Oriented Enterprise Application Development Introduction to JDBC.
Advanced Java Programming – Eran Toch Methodologies in Information System Development Tutorial: Advanced Java Programming and Database connection Eran.
1 Foundations of Software Design Lecture 27: Java Database Programming Marti Hearst Fall 2002.
Murali Mani Web Interface. Murali Mani Options PHP with mySQL JSP/Servlets with JDBC on mySQL/Oracle Others …
Three-Tier Architecture Oracle DB Server Apache Tomcat App Server Microsoft Internet Explorer HTML Tuples HTTP Requests JDBC Requests Java Server Pages.
JDBC CS 122. JDBC zJava Database Connectivity zDatabase Access Interface Õprovides access to a relational database (by allowing SQL statements to be sent.
1 CSC 440 Database Management Systems JDBC This presentation uses slides and lecture notes available from
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
JDBC. What is JDBC JDBC is an acronym for –Java Data Base Connectivity. It allows java/jsp program to connect to any database.
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.
Distributed Systems Lab Lecture -1-.  It is extremely simplified application will be realized with the aid of various middleware technologies.  It allows.
Georgia Institute of Technology Making Text for the Web part 5 Barb Ericson Georgia Institute of Technology March 2006.
MySQL, Java, and JDBC CSE 3330 Southern Methodist University.
JDBC Tutorial MIE456 - Information Systems Infrastructure II Vinod Muthusamy November 4, 2004.
JDBC (Java Database Connectivity) SNU OOPSLA Lab. October 2005.
JAVA Database Access. JDBC The Java Database Connectivity (JDBC) API is the industry standard for database- independent connectivity between the Java.
CS 405G: Introduction to Database Systems Database programming.
 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.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
Index and JDBC/JSP tutorial Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
JDBC Enterprise Systems Programming. JDBC  Java Database Connectivity  Database Access Interface provides access to a relational database (by allowing.
Chapter 8 Databases.
Accessing Database using JDBC. JDBC Objectives Gain basic knowledge of Java JDBC Become familiar with the basics of interacting with a database using.
Chapter 25 Databases. Chapter Scope Database concepts Tables and queries SQL statements Managing data in a database Java Foundations, 3rd Edition, Lewis/DePasquale/Chase25.
JDBC Database Programming in Java Prepared by., Mrs.S.Amudha AP/SWE.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
JDBC CS 124. JDBC Java Database Connectivity Database Access Interface provides access to a relational database (by allowing SQL statements to be sent.
Java and Databases. JDBC Architecture Java Application JDBC API Data Base Drivers AccessSQL Server DB2InformixMySQLSybase.
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.
CSI 3125, Preliminaries, page 1 JDBC. CSI 3125, Preliminaries, page 2 JDBC JDBC stands for Java Database Connectivity, which is a standard Java API (application.
Basics of JDBC.
JDBC (Java Database Connectivity)
Introduction to JDBC Instructor: Mohamed Eltabakh 1.
JDBC Java and Databases. SWC – JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
1 JDBC – Java Database Connectivity CS , Spring 2010.
1 Download current version of Tomcat from: g/tomcat/ g/tomcat/ Install it in: C:\Program Files\Apache.
In the Name Of Almighty Allah. Java Application Connection To Mysql Created by Hasibullah (Sahibzada) Kabul Computer Science Faculty Afghanistan.
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
JSP/Database Connectivity Instructor: Dr. M. Anwar Hossain.
CSC 411/511: DBMS Design Dr. Nan WangCSC411_L12_Oracle10g_JDBC 1 Application Development (JDBC)
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
Database Programming Basic JDBC Programming Concepts.
JSP and DB.
CS3220 Web and Internet Programming Database Access with JDBC
Java Access to RDB Relational databases (RDBs) dominate today, due to:
JDBC – Java Database Connectivity
CS320 Web and Internet Programming Database Access with JDBC
Advanced Web Automation Using Selenium
HW#4 Making Simple BBS Using JDBC
Prof: Dr. Shu-Ching Chen TA: Sheng Guan
Client Access, Queries, Stored Procedures, JDBC
Super Market Management
Bolat Azamat, Kim Dongmin
Using a Database with JDBC
JDBC Example.
CS3220 Web and Internet Programming Database Access with JDBC
CS3220 Web and Internet Programming Database Access with JDBC
Presentation transcript:

Tasks Needed for MissionMapEditor Martin Q. Zhao September 18, 2010

DB Connectivity In MMEditor Provide high level functions Provide query level functions Encapsulate JDBC constructs: Driver, Connection, Statement

DAO JDBC Framework DB Table DBMS Application (client) DB Server Driver Connection Statement ResultSet creates executes returns java.sql MMEditor MySQL Server Instance mysql-connector.jar implements

New DB Functions 4 MMEditor Add updateMapToDb Add updateMission deleteMission Similar design can be used in VulnerabilityTracker

Sample JDBC Code Get connection to DB server Run query and process results // set driver String driverName = "com.mysql.jdbc.Driver"; try { Class.forName(driverName); } catch (ClassNotFoundException e) { } // get connection urlBase = "jdbc:mysql://localhost:3306/“ try { conn = DriverManager.getConnection(urlBase + dbName, user, pwd); } catch (SQLException e) {} // get statement, which embodies queries try { stmt = conn.createStatement(); } catch (SQLException e) {} Driver Connection Statement ResultSet creates executes returns java.sql

Sample JDBC Code - continued Execute update commands Run query and process results // execute an insert statement String insertCommand = "INSERT INTO Mission VALUES ("; insertCmd += m.getId() + ", '" + m.getName() +"', null, 1, " + lookupMissionId(m.getType()) + ",1"; insertCommand += ")"; int rowsAffected = 0; try { rowsAffected = stmt.executeUpdate(insertCmd); } catch (SQLException e) {} // execute an select query String query = "SELECT SubMissionId FROM MissionSubMissionMap "+ "WHERE MissionId = " + parentMissionId; LinkedList ids = new LinkedList (); try { ResultSet rs = stmt.executeQuery(query); while (rs.next()) { ids.addLast(rs.getLong(1)); } } catch (SQLException e) {}