85
JSF JDBC Connection
You can integrate JSF application to the jdbc. JDBC allows you to store data into the database table.
In this tutorial, we are creating an application and creating jdbc connectivity to store data input by the user.
This application contains a user input form, a managed bean, a response page and the following steps.
Create Database and Table
we have used mysql database to create database and table.
Create Database
Select Database
Create table
See Table Structure
After creating database and table, now create a user form to get user input.
Creating a Form
// index.xhtml
Create a Manged Bean
This file contains properties, database connection and page navigation as well.
// User.java
Create a Response Page
// response.xhtml
Output:
User Form (Index Page)
Response Page
Now, you can see data into the table.
All set! Data has been inserted.
Next TopicJSF CRUD Example