Download Oracle Multimedia User's Guide

Transcript
Description of the IMExample Application
OracleConnection conn = null;
OracleResultSet rs = null;
OraclePreparedStatement pstmt = null;
boolean isInsertNeeded = false;
byte[] ctx[] = new byte[1][64];
try
{
conn = IMExample.getDBConnection();
pstmt = (OraclePreparedStatement)conn.prepareStatement(sQuery);
pstmt.setInt(1, m_iProdId);
rs = (OracleResultSet)pstmt.executeQuery();
if (rs.next() == true)
{
m_img = (OrdImage)rs.getORAData(1, OrdImage.getORADataFactory());
m_imgThumb = (OrdImage)rs.getORAData(2, OrdImage.getORADataFactory());
m_aud = (OrdAudio)rs.getORAData(3, OrdAudio.getORADataFactory());
m_vid = (OrdVideo)rs.getORAData(4, OrdVideo.getORADataFactory());
m_doc = (OrdDoc)rs.getORAData(5, OrdDoc.getORADataFactory());
}
displayMedia();
rs.close();
pstmt.close();
}
finally
{
IMUtil.cleanup(rs, pstmt);
}
}
private void displayMedia() throws SQLException, IOException
{
displayImage();
displayAudio();
displayVideo();
displayDoc();
}
/**
* Add the product photo panel.
*/
private void displayImage() throws SQLException, IOException
{
m_jImgPanel = new IMImagePanel(this,
m_img, m_imgThumb, m_iProdId, m_colorFieldBg);
m_jImgPanel.display();
m_jImgPanel.getAccessibleContext().setAccessibleName
("Product photo panel");
m_jImgPanel.getAccessibleContext().setAccessibleDescription
("Product photo panel with an image icon on the left, " +
"image attribute panel in the middle and image control" +
"panel on the right.");
m_jMediaPanel.add(m_jImgPanel);
Component jImgFocus = m_jImgPanel.getFirstFocusComponent();
}
Oracle Multimedia IMExample Sample Application
5-5