B customizing sample applications, Customizing petclinic, Added directories – HP Integrity NonStop J-Series User Manual

Page 135: Mxci, Added file, Setdatabase.java, Added directories added file, Appendix b: customizing sample applications

Advertising
background image

B Customizing Sample Applications

This appendix provides information about how PetClinic and JPetStore sample applications were
customized to run on NonStop systems.
You can download the Spring sample applications from

http://src.springframework.org/ svn/

spring-samples.

Customizing PetClinic

To customize the PetClinic sample application to run on NonStop systems, two directories and one
file were added, and four files were modified.
Added Directories:

/mxci

/etc

Added File:

SetDatabase.java

Modified Files:

web.xml

petclinic.hbm.xml

applicationContext-dataSource.xml

jdbc.properties

Added Directories

/mxci

(<My SASH Home>\spring\samples\petclinic\src\main\resources\db\mxci)

This directory contains the database script that is required to set up the PetClinic database on
SQL/MX.

/etc

(<My SASH Home>\spring\samples\petclinic\etc)

This directory is included in the SAMPLES.zip file and contains the hibernate3sqlmx.jar
file.

Added File

SetDatabase.java

(<My SASH Home>\spring\samples\petclinic\src\main\java\org\
springframework\samples\petclinic\datasource\SetDatabase.java)

The SetDatabase.java file was created, in the
org.springframework.samples.petclinic.datasource

package, for adding customized

connection properties to the JDBC driver.
The SetDatabase.java class file appeared as:

package org.springframework.samples.petclinic.datasource;

import org.apache.commons.dbcp.BasicDataSource;

public class SetDataSource extends BasicDataSource{
private String catalog;
private String schema;
public void setCatalog(String catalog) {

Customizing PetClinic

135

Advertising
This manual is related to the following products: