2. Previous Work Review
• http://pirate.shu.edu/~marinom6/work.html
• Please Note only previously due HW assignments are posted on my
pirate.shu.edu web space
• Begin organizing your creating files for this course into an easy to find folder
on your desktop for easy FTP later on
3. Basics
• JDBC stands for Java Database Connectivity
• JDBC connects databases and handles SQL queries and responses
• JDBC is an API or application programming interface
• Commands are sent within JDBC using the Java programming language
• Within the java.sql package the DriverAction function implements the Driver
4. JDBC: SQL Function Calls for Java
Programming
• JDBC
• Java function libraries
• Single Java program can connect to several different databases
• Called data sources accessed by the Java program
• Class.forName("oracle.jdbc.driver.OracleDriver")
• Load a JDBC driver explicitly
5. JDBC: SQL Function Calls for Java
Programming
• Connection object
• Statement object has two subclasses:
• PreparedStatement and CallableStatement
• Question mark (?) symbol
• Represents a statement parameter
• Determined at runtime
• ResultSet object
• Holds results of query
8. What to do with JDBC
• Making a connection to a database.
• Creating SQL or MySQL statements.
• Executing SQL or MySQL queries in the database.
• Viewing & Modifying the resulting records.
9. What Works with JDBC
• Java Applications
• Java Applets
• Java Servlets
• Java ServerPages (JSPs)
• Enterprise JavaBeans (EJBs).
10. Important Java Packages
Packages that use java.sql
Package Description
java.sql Provides the API for accessing and processing data stored in a data
source (usually a relational database) using the Java
TM
programming
language.
javax.sql Provides the API for server-side data source access and processing
from the Java
TM
programming language.
javax.sql.rowset Standard interfaces and base classes for
JDBC RowSet implementations.
javax.sql.rowset.serial Provides utility classes to allow serializable mappings between SQL
types and data types in the Java programming language.
javax.sql.rowset.spi The standard classes and interfaces that a third-party vendor has to
use in its implementation of a synchronization provider.
11. Important Aspects for Us
ResultSet A table of data representing a database result set, which is usually generated by executing a statement that queries the database.
ResultSetMetaData An object that can be used to get information about the types and properties of the columns in a ResultSet object.
12. What are Assumptions?
• In database design assumptions are statements we assume to be true, but
may not be obvious to other individuals
• Example, I assume you are reading these PowerPoints and not just watching
the video lectures
13. Building Assignment 13
Course Instructor Credits
BITM 2701
Management Information Systems
Marino 3
BITM 3730
Developing Web Applications
Marino 3
14. Building Assignment 13
Assumptions
• The data can be edited to add and remove input as needed
• We might need to split up Course into Course Number and Course Name at a later point
• The Course data type will be VARCHAR(#) to allow the use of any characters (numbers and letters) as input
• Ideally, we have enough characters to account for any input
• The Instructor data type will be Text(#) to allow the use of only text (letters) as input
• Ideally, we have enough letters to account for any input
• The Credits data type will be Int(1) to allow for one number as input
• This is due to all credit possibilities (1, 2, 3, 4, 5, etc.) all being only 1 integer