Chinaunix首页 | 论坛 | 博客
  • 博客访问: 735074
  • 博文数量: 803
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 5015
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-28 10:29
文章分类

全部博文(803)

文章存档

2011年(1)

2008年(802)

我的朋友

分类:

2008-10-29 11:50:00


  interMedia是推出的对8i多媒体功能的扩充,包括image, audio, video三部份。interMedia使用对象类型,类似于JAVA或,来描述image, audio, video类型数据,Oracle在这三类对象中定义了许多方法来操作这些数据,如对于 image类型数据来说,你可以很方便地进行图形格式转换,压缩,拷贝,截取图形的任何一部份等,而这些是普通LOB类型数据所无法比拟的。
  
  Internet的发展更突出了interMedia在WEB应用中的价值,现有的WEB应用绝大多数将image存在文件系统中,其优点是操作简单,速度快,缺点是管理复杂,尤其是管理大量image时就受到目录数等的限制。如果将image保存在数据库中,由数据库来统一维护,统一备份,这样就可以简化管理。至于存取速度则涉及到整个系统的体系结构,可以通过增加中间层来提高访问速度。
  
  如何应用interMedia呢?
  
  Oracle提供两种方法,一种是用JSP和Servlet调用Oracle提供的interMedia JAVA类库来存取image,其优点是自己可以控制程序,灵活,缺点是复杂,需要自己编写程序。Oracle提供了例子供大家参考,大家可以到 选择Use 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
   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中打开
  选择商店的颜色,输入你的招呼语,然后点击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
  
【责编:admin】
--------------------next---------------------

阅读(536) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~