OpenSource For You

A step-by-step guide to building a login applicatio­n using MVC

-

For this applicatio­n, we will use the JavaDB database.

To create the database, open the as shown in Figure 4.

Using the Services tab, we can configure, add and delete databases, Web servers and many other configurat­ions. To create the new database, expand Databases by clicking on the black triangle. This will display the configured databases. For now we can see JavaDB. Right click on JavaDB and select the Create database option as shown in Figure 5.

A new window with the title ‘Create Java DB’ will pop up and ask for the database’s name, user name and password.

Remember that the database’s name, user name and password will be needed later in querying the database. After filling in the necessary details, click on OK. In the Services panel, the user database can be seen in JavaDB. Right click on User and click on the Connect option as shown in Figure 6.

Once the database is connected, we can see an entry like jdbc:derby://localhost:1527/user/ in the Services panel itself. Expand the entry, which will show ROOT. Expand the ROOT and Tables is displayed. Right click on Tables and click on Create table as shown in Figure 7.

It will open the Create table dialogue box. Fill in the table’s name. We will use ‘login’ as the table’s name and click on the Add column button.

Add column will open a new dialogue box and ask for the column’s name, type, size and constraint­s. Under the column name, enter email, in type: varchar, in constraint: select Primary Key.

Clicking OK will display the Create table dialogue box. Next, click on Add column again; Services tab

 ??  ?? Figure 6: Connecting the database
Figure 6: Connecting the database
 ??  ?? Figure 7: Creating the option
Figure 7: Creating the option

Newspapers in English

Newspapers from India