Customizing jpetstore, Added file, Setdatabase.java – HP Integrity NonStop H-Series User Manual
Page 156: Modified files, Build_jdbct2.xml

#
#
#
#
Customizing JPetStore
To customize the JPetStore sample application to run on NonStop systems, one file was added
and six files were modified:
Added File:
•
Modified Files:
•
•
•
•
•
•
Added File
The following file was added to customize JPetStore:
SetDatabase.java
(
property\SetDatabase.java)
:
A new package
org.springframework.samples.jpetstore.property
and a Java class
SetDatabase.java
was created. The
SetDatabase.java
class file is used for adding
customized connection properties to the JDBC driver.
The
SetDatabase.java
class file appeared as:
package org.springframework.samples.jpetstore.property;
import org.apache.commons.dbcp.BasicDataSource;
public class SetDatabase extends BasicDataSource{
private String catalog;
private String schema;
public void setCatalog(String catalog) {
this.catalog=catalog;
addConnectionProperty("catalog",this.catalog);
}
public void setSchema(String schema) {
this.schema=schema;
addConnectionProperty("schema",this.schema);
}
Modified Files
The following files were modified to customize JPetStore:
build_jdbct2.xml
(
property\build_jdbct2.xml):
This is the build file for JPetStore when using the JDBC Type 2 driver for database connectivity.
156
Customizing Sample Applications