Creating the iemployeedao.java file – HP Integrity NonStop J-Series User Manual

Page 425

Advertising
background image

</welcome-file-list>

</web-app>

Creating the IEmployeeDao.java File

Create a Java interface named IEmployeeDao.java to implement the EmployeeDao.java
class. The IEmployeeDao.java is placed with its implementation class in the
com.hp.empinfo.service

package.

To create the IEmployeeDao.java file, complete the following steps:

1.

On the Project Explorer frame, right-click EmpInfo and select New > Interface.

The New Java Interface dialog box appears.

2.

In the Source folder field, enter EmpInfo/src and in the Package field, enter
com.hp.empinfo.service

.

3.

In the Name field, enter IEmployeeDao and click Finish.

Figure 175

shows the New Java Interface dialog box.

Figure 175 New Java Interface Dialog Box

The IEmployeeDao.java file is created.

4.

Modify the IEmployeeDao.java file to declare the methods implemented in the
EmployeeDao.java

file.

After modifications, the IEmployeeDao.java file must appear as shown:

package com.hp.empinfo.service;
import java.sql.SQLException;

import com.hp.empinfo.domain.Employee;

public interface IEmployeeDao {

/**Retrieve employee Details corresponding to provided employeeId**/
public Employee getDetail(int empid) throws SQLException ;

/**Inserting employee Details**/
public void insertDetail(int empid, String firstname, String lastname,

Example of Integrating MyFaces into Spring 425

Advertising
This manual is related to the following products: