Building Web Applications with JSP: Integrating a JSP App with a Database

Java    |    Intermediate
  • 13 videos | 1h 41m 18s
  • Includes Assessment
  • Earns a Badge
Rating 4.3 of 7 users Rating 4.3 of 7 users (7)
Discover how to connect a JSP website to a database and allow end-users to perform database operations from the web UI using this course. Learn how to set up a MySQL database, use JDBC to connect to and run queries against this database, and utilize the JSTL library in order to iterate over the data that is returned and render them on your web page. You'll also explore write operations, JSP action tags like useBean and setProperty, and implementing update and delete operations on the database. After finishing this course, you'll have the skills and knowledge to allow users of a JSP website to interact with a database.

WHAT YOU WILL LEARN

  • Discover the key concepts covered in this course
    Set up mysql server on your machine
    Create a database schema and table and load it with data
    Use jdbc to connect to and query a sql database from a jsp app
    Deploy and test the connectivity from your jsp app to a database and ensure that queried data is displayed correctly
    Define a class representing an entity whose details are stored in the database and which an end-user of your app will work with
    Use jdbc objects to query for single or multiple rows in a database table
  • Implement tags from the jstl library to iterate over multiple rows of data
    Execute an insert query from a java application to add a new row of data to a sql table
    Automate the creation and population of a java object with the usebean and setproperty tags in a jsp
    Enable end-users to update existing rows in a database table via your jsp app
    Allow end-users to delete rows from a database table through the ui of your jsp app
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 2m 27s
    JavaServer Pages, or JSP, is a collection of technologies that simplify dynamic website construction.  Discover how to leverage the power of the Java programming language to build rich, responsive, and easy-to-maintain websites. Discover ways to seamlessly handle website errors. Design sites that offer the best possible browsing experience. This course will prepare you to connect a JSP website to a database server and enable end users to perform database operations from the web UI. FREE ACCESS
  • 6m 51s
    Build on your existing relational database skills and learn to integrate your JSP web app with a MySQL database. See how to download and install MySQL from the free MySQL Community Server. Enter your administrative credentials and set up your root user database password. Use a command shell to access and verify that your installation runs and then connect to your database. FREE ACCESS
  • Locked
    3.  Creating and Populating a Database Table
    9m 4s
    Learn how to download and install a client to connect to your MySQL database and validate your JSP interactions. Use MySQL Workbench to establish a connection. Run the query editor to test JSPDatabase access. Create a new table for your JSPDatabase app. Set up and populate example fields in a customer database. Examine the Result Grid to confirm that your example customers are now inside your Customers table. FREE ACCESS
  • Locked
    4.  Connecting a JSP App to a SQL Database
    12m 4s
    In this video, you will see how to build a JSP application that you will then connect to a SQL database to query customer data. Import classes defined in the java.sql library to establish Java database connections. Learn the proper syntax to execute MySQL connection strings and access the Java Database Connectivity (JDBC) Application Programming Interface (API). Run while loops to populate your database tables. Add a dependency to your Maven pom.xml file. FREE ACCESS
  • Locked
    5.  Testing a JSP App's Connectivity to the Database
    3m 28s
    In this video, you will see how to deploy and test the connectivity of your JSP application with a MySQL database, and ensure that queried data correctly displays. Use a terminal command to rebuild and package your application for deployment to your Apache Tomcat server. Confirm that the server uses port 8080. Load index.jsp to run connectivity tests and execute test queries. FREE ACCESS
  • Locked
    6.  Working with a Model Class
    7m 18s
    This video shows you best practices to let you define a class that represents an entity whose details are stored in a database that your app can use. Work with model, view, and controller components in separate files. Build up the UserDAO (User Data Access Object) to include interfaces to query a database, and create and maintain user access. Define style elements. FREE ACCESS
  • Locked
    7.  Retrieving Single and Multiple Rows from a Table
    10m 16s
    This video shows you how to use JDBC objects to query for single or multiple rows in a database table. Define methods to read from tables and write to tables. Use the getConnection method. Invoke DriverManager.getConnection to pass usernames, passwords, and URLs. Create a list of user objects from customer data. Run ps.executeQuery to return a ResultSet. Implement a while loop to handle multiple results. FREE ACCESS
  • Locked
    8.  Displaying Data Using JSTL
    11m 24s
    This video shows you how to implement tags from the JSTL library to iterate over multiple rows of data. Invoke the getAllRecords method in the UserDAO class to retrieve information and display it in a table. Use a JSP scriptlet and JSP expressions to make a call to UserDAO.getAllRecords and return a list of user objects. FREE ACCESS
  • Locked
    9.  Adding New Data to a SQL Table
    8m 21s
    This video demonstrates how to execute an insert query from a Java application and add a new row of data to a SQL table. Add a new function to accept a User object. Create an adduserform. Define functions for the UserDAO class. Set the page title in HTML and define style elements. Set POST methods. FREE ACCESS
  • Locked
    10.  Working with jsp:useBean and jsp:setProperty Tags
    9m 2s
    This video shows you how to automate the creation and population of a Java object with the useBean and setProperty tags in a JSP.  Make the UserDAO class include a page directive with an import. Setup a user object and all of its fields with the contents of the post data through jsp:useBean and jsp:setProperty tags. Generate a WAR file and copy it to the Tomcat server. FREE ACCESS
  • Locked
    11.  Updating a Database Table via a JSP App
    11m 44s
    This video shows you how to let end-users update existing rows in a database table via a JSP application. Invoke the setString method of a PreparedStatement and invoke the Getter method for your data. Invoke the UserDAO.getRecordById method. Create a hidden input type which contains the id of the user being updated. Create a new Java Bean instance out of a user. Invoke u.getEmail and u.getName to populate text input fields. Invoke UserDAO.update. FREE ACCESS
  • Locked
    12.  Deleting Rows from a Database Table
    6m 58s
    This video shows you how to allow end-users delete rows from a database table through the user interface (UI) of your JSP application. Create a deleteuser.jsp and a new delete method for UserDAO.java. Invoke ps.setInt and u.getId. Run ps.executeUpdate. Implement a catch block and return the status. Copy the WAR file to the Tomcat webapps. Execute an lsof command to help you clear up port 8080 when you are done. FREE ACCESS
  • Locked
    13.  Course Summary
    2m 21s
    This video summarizes how to connect a JSP website to a database server and enable end users to perform database operations from the web UI. This includes how to read from a database table, create new rows, and update and delete existing rows. You will review how to use a MySQL database, JDBC, Queries, Connection, PreparedStatement,  ResultSet, JSTL library, useBean, and setProperty in your development process. FREE ACCESS

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

YOU MIGHT ALSO LIKE

Rating 4.3 of 48 users Rating 4.3 of 48 users (48)
Rating 4.8 of 5 users Rating 4.8 of 5 users (5)
Rating 4.4 of 24 users Rating 4.4 of 24 users (24)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.7 of 60 users Rating 4.7 of 60 users (60)
Rating 3.6 of 10 users Rating 3.6 of 10 users (10)
Rating 4.7 of 27 users Rating 4.7 of 27 users (27)