中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 数据库开发 > Oracle
谈谈Oracle数据库中InterMedia的用法
作者:佚名 时间:2007-06-16 14:58 出处:ccidnet.com 责编:月夜寒箫
              摘要:谈谈Oracle数据库中InterMedia的用法

interMedia是Oracle推出的对Oracle8i多媒体功能的扩充,包括image, audio, video三部份。interMedia使用对象类型,类似于JAVA或C++,来描述image, audio, video类型数据,Oracle在这三类对象中定义了许多方法来操作这些数据,如对于 image类型数据来说,你可以很方便地进行图形格式转换,压缩,拷贝,截取图形的任何一部份等,而这些是普通LOB类型数据所无法比拟的。

Internet的发展更突出了interMedia在WEB应用中的价值,现有的WEB应用绝大多数将image存在文件系统中,其优点是操作简单,速度快,缺点是管理复杂,尤其是管理大量image时就受到目录数等的限制。如果将image保存在数据库中,由数据库来统一维护,统一备份,这样就可以简化管理。至于存取速度则涉及到整个系统的体系结构,可以通过增加中间层来提高访问速度。

如何应用interMedia呢?

Oracle提供两种方法,一种是用JSP和Servlet调用Oracle提供的interMedia JAVA类库来存取image,其优点是自己可以控制程序,灵活,缺点是复杂,需要自己编写程序。Oracle提供了例子供大家参考,大家可以到http://technet.oracle.com/sample_co...code_index.htm, 选择Use Java Servlets & JSPs to load/retrieve rich content。这个例子比较简单,安装、运行都有详细说明,我采用的是Tomcat 3.1 for WinNT来运行。

第二种方法就是本文将重点介绍的利用Oracle interMedia Web Agent实现image的上传和显示以及如何限制上传的image的属性。

什么是Oracle imterMedia Web Agent?

它是用来解析URL来存取多媒体数据,是Oracle提供的用于在WEB上存取多媒体数据的工具,它大大简化了对多媒体数据的操作,目前支持的WEB Server有:Apache, Oracle Application Server, Netscape Server, 以及Microsoft IIS。

Oracle还在NT平台上提供了一个利用Oracle interMedia Web Agent管理多媒体数据的工具,Oracle 8i interMedia Clipboard, 利用这个工具可以自动生成操作的存储过程代码,大家可以将这些代码作为模板修改,以增强功能。

如何利用Oracle Web Agent来操作image数据呢?

本文将以我在开发WEB项目中的部分程序为例,简要说明用法,详细的步骤还需要大家仔细阅读例子安装说明,如在使用中遇到说明,可以去Oracle爱好者之家的新技术论坛 ,我会尽力回答大家的问题。

关于例子(包括以下文件):

  
enter_mistore_pict.htm – upload picture page

disp_mistore_pict.htm – display picture page

mistore_upload_test.sql – create table and stored procedure script

upload_err.htm – upload image error page

系统要求:

 

 
300MHz CPU 128MB memory (256 / 380 for performance),
500MB free disk, CD, sound & video
Windows NT 4.0 SP3 or 5, network software installed
Oracle8i 8.1.5 Server + client software + SQL utilities
Apache Web Server Release 1.3.4 to 1.3.12 for NT
Oracle interMedia Web Agent for NT
Netscape Browser 4.5 or greater or Microsoft Internet Explorer 5.0

安装步骤:

以scott/tiger用户执行mistore_upload_test.sql, create table and stored procedure。

下载并安装Apache Web Server Release 1.3.4 to 1.3.12 for NT。

下载并安装Oracle interMedia Web Agent for NT, 选择WEB Server为Apache。

将所有htm考到Apache Web Server的根目录下,如C:\Program Files\Apache Group\Apache\htdocs。

启动Apache Web Server。

在Web Agent中创建一个test Agent:

  Open "http:/localhost/intermedia/admin" in your web browser. 
Click on Database Agents in the left pane.
Click on Create in the right pane and then type in following values:
agent name:
Test

service:
(Use the service name defined in your tnsnames.ora file.)

database_user:
scott

database_password:
tiger

authorized_request_class:
clipboard

authorized_sql_statements:
any

authorized_sql_procedures:
*


Click on Submit at the bottom of the page. Click on Apply.

例子使用说明:

在IE或Netscape中打开http://localhost/enter_mistore_pict.htm。

选择商店的颜色,输入你的招呼语,然后点击Browse…选择一幅图代表你的LOGO,注意对图的限制为:450X100,格式为GIF或JPEG。

点击upload Logo保存所有信息到stores表中,如果你的图不合规格则会出错提示。若一切正常则显示你的LOGO。

若想了解更多,请参考以下资料:

Coloring the Information Superhighway By Douglas Scherer (Oracle Magzine)

Oracle8i interMedia -- Using Oracle8i interMedia with the Web

 
关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有