Login Example: JSP and Servlets: Part II.

Hello Friends,

This is part II of jsp and servlets login example. Check Part I here.

Step 4) Now, we need to create a Servlet file for the redirection of the jsp pages. In the src folder under the package code2java, add the Servlet file and name it as LoginServlet. As discussed earlier this servlet file will get the user details from the Bean file and then it will create a Session for that user only if the user is a valid user. And accordingly it will redirect to the respective jsp pages. You can use the default code which Eclipse generates while Servlet creation, the only change you need to do is in doGet() method. Continue reading “Login Example: JSP and Servlets: Part II.”

Login Example – JSP and Servlets: Part I.

Hello Friends,

This is one of the tutorials on JSP and Servlets. In this we will discuss and create a simple login application using servlets and JSP where we will connect to the DB for the user credentials and then authenticate the users accordingly. First of all we will discuss about what we will need for this.

JSP Pages:

We will create three JSP pages which will be the only viewable parts of our code. The three pages will be as Login Page, Login Success page and the Invalid Login page. Continue reading “Login Example – JSP and Servlets: Part I.”

JDBC – Insert, Update and Delete example.

Hello Friends,

This is the simple example for executing the SQL statements to INSERT, UPDATE or DELETE any records from the database using JDBC. In the below code I have explained all the three operations. When we insert, update or delete any records from the database we are updating the database, hence we use the executeUpdate() function with the Statement.

Continue reading “JDBC – Insert, Update and Delete example.”

JDBC and MySQL Connection tutorial.

Hello Friends,

One of the significant characteristic of any programming language is its connectivity with the database and its operations. Java supports many options to connect to the database and one of the most used database is MySql. JDBC (Java Data Base Connectivity) is used for connecting the java code with the database and it provides cross-DBMS connectivity to a wide range of SQL databases and access to other tabular data sources, such as spreadsheets or flat files. This tutorial shows the jdbc and mySql connection establishment and its use.

Continue reading “JDBC and MySQL Connection tutorial.”

Error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Hello Friends,

You may have come across “java.lang.ClassNotFoundException: com.mysql.jdbc.Driver” error/exception while working with java and JDBC. The error occurs mainly when we try to connect to the mySql database from our java code. The error message itself give the clear indication about what we are missing. It says that it is unable to find the Class – “com.mysql.jdbc.Driver”. Continue reading “Error: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver”

JSP Redirection from a Servlet.

Hello Friends,

This tutorial is regarding the jsp redirection from a Servlet to a another jsp page. Most of you may need to redirect the user to a jsp page being on the servlet page. This tutorial will help you. There are two ways to achieve this, we will discuss them both.

Continue reading “JSP Redirection from a Servlet.”

Servlet program using Eclipse IDE.

Hello Friends,

This tutorial is regarding development of Servlet program using Eclipse IDE. Eclipse IDE is very popularly used for development of various web based and java applications. Servlet applications are very easily developed using the eclipse IDE. Following are the simple steps for the same.

Step 1) Open the Eclipse IDE and set the Perspective to Java EE (if not set by default). Continue reading “Servlet program using Eclipse IDE.”

Adding Custom Tabs in Jira.

Hello Friends,

This is one of my tutorials regarding the enhancement in the Jira application. There are limited number to tabs in the Jira Application, but what if we need to add or change the tabs in the application. Its really very simpl, we need to add a short snippet in the existing code of Jira. Continue reading “Adding Custom Tabs in Jira.”