120 likes | 335 Views
Database Connection. Connection Statement ResultSet PreparedStatement Problem: Course Type Management. Connection. A connection (session) with a specific database. Within the context of a Connection, SQL statements are executed and results are returned. Statement.
E N D
Connection • Statement • ResultSet • PreparedStatement • Problem: Course Type Management
Connection • A connection (session) with a specific database. • Within the context of a Connection, SQL statements are executed and results are returned.
Statement • The object used for executing a static SQL statement and returning the results it produces. • By default, only one ResultSet object per Statement object can be open at the same time. • Statement stmt = Conection.createStatement();
ResultSet • A table of data representing a database result set, which is usually generated by executing a statement that queries the database • ResultSet rs = stmt.executeQuery(sql);
PreparedStatement • An object that represents a precompiled SQL statement. • A SQL statement is precompiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times. • PreparedStatement psta = Connection.prepareStatement(sql); • psta.execute();
5. Problem: Course Type Management • Develop a web app to manage course type. Each course type include ID, name and description. • The web app allows users list all of course types, add new, delete and update a course type.
Sample Interface • List of Course Types
Select Course Type checkbox and click to Delete Button Delete Course Type
Update Course Type Click to “AAS”