1 / 12

Database Connection

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.

shaman
Download Presentation

Database Connection

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database Connection

  2. Connection • Statement • ResultSet • PreparedStatement • Problem: Course Type Management

  3. Connection • A connection (session) with a specific database. • Within the context of a Connection, SQL statements are executed and results are returned.

  4. 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();

  5. 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);

  6. 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();

  7. 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.

  8. Sample Interface • List of Course Types

  9. Add new Course Type

  10. Select Course Type checkbox and click to Delete Button Delete Course Type

  11. Update Course Type Click to “AAS”

More Related