Imagecontroller.java, Imagedatabase.java, Imagecontroller.java imagedatabase.java – HP Integrity NonStop H-Series User Manual
Page 164

#jdbc.url=jdbc:sqlmx://
#jdbc.username=
#jdbc.password=
#-------------------------------------------------------------------------------
# SQL/MX Settings for JDBC Type 4 Driver
#jdbc.driverClassName=com.tandem.t4jdbc.SQLMXDriver
#jdbc.url=jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.>
#jdbc.username=<HP NonStop Username>
#jdbc.password=<HP NonStop Password>
#For JDBC Type 4 Driver:
#<HP NonStop System IP Address> - This is the IP address of your NonStop system
#<Port No.> - This is the Port Number of JDBC Data Source
#<HP NonStop Username> - This is the HP NonStop system UserName
#<HP NonStop Password> - This is the HP NonStop system Password
ImageController.java
(<Spring Home>\samples\imagedb\src\org\springframework\samples\ imagedb\
web\ImageController.java)
:
This is the
MultiActionController
controller class that contains the
RequestMapping
for
the request for Insertion, Retrieval, and Deletion. BLOB is not directly supported by the SQL/MX
database; it is handled by the BLOB/CLOB handler classes in the SQL/MX driver
JAR
file. This
class is modified to use the BLOB.
Changes to the
ImageController.java
file
Before the change:
@RequestMapping("/imageUpload")
public String processImageUpload(@RequestParam("name") String name,
@RequestParam("description")
String description,@RequestParam("image") MultipartFile image)
throws IOException
{
this.imageDatabase.storeImage(name, image.getInputStream(),
(int) image.getSize(), description);
return "redirect:imageList";
}
After the change:
@RequestMapping("/imageUpload")
public String processImageUpload(@RequestParam("name") String name,
@RequestParam("description")
String description,@RequestParam("image") MultipartFile image)
throws IOException
{
this.imageDatabase.storeImage(name, image.getBytes(),
description);
return "redirect:imageList";
}
ImageDatabase.java
(<Spring Home>\samples\imagedb\src\org\springframework\samples\imagedb
\web\ImageDatabase.java)
:
This is the central business Java interface of ImageDB. It contains method signatures that are
used by ImageDB. BLOB is not directly supported by the SQL/MX database; it is handled by the
BLOB/CLOB handler classes in the SQL/MX driver JAR file. This class is modified to use BLOB.
Changes to the
ImageDatabase.java
file
Before the change:
164
Customizing Sample Applications