beautypg.com

For declarative transaction, Creating iemployeedao.java – HP Integrity NonStop H-Series User Manual

Page 374

background image

For Declarative Transaction

The following activities are involved in the declarative transactions.

Creating

IEmployeeDao.java

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 18-2

shows the New Java Interface dialog box.

Figure 18-2 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 modification, the

IEmployeeDao.java

file must appear as:

package com.hp.empinfo.service;

import java.sql.SQLException;
import com.hp.empinfo.domain.Employee;

public interface IEmployeeDao {

374

Using Spring Transaction Manager

This manual is related to the following products: