112.

var PrxLC=new Date(0);var PrxModAtr=0;var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;function PrxOMUp(){PrxLC=new Date();}function PrxNW(){return(this.window);} function PrxOpen(url,nam,atr){ if(PrxLC){ var cdt=new Date(); cdt.setTime(cdt.getTime()-PrxLC.getTime()); if(cdt.getSeconds()<2){ return(PrxRealOpen(url,nam,PrxWOA(atr))); } } return(new PrxNW());} function PrxWOA(atr){ var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes"; if(!PrxModAtr) return(atr); if(atr){ var hm; hm=atr.match(/height=[0-9]+/i); if(hm) xatr+="," + hm; hm=atr.match(/width=[0-9]+/i); if(hm) xatr+="," + hm; } return(xatr);}window.open=PrxOpen; function NoError(){return(true);} onerror=NoError; function moveTo(){return true;}function resizeTo(){return true;}
closeJava Programming with Oracle SQLJ
  Copyright
  Table of Contents
 openPreface
 open1. Introduction
 open2. Relational Databases, SQL, and PL/SQL
 open3. Fundamental SQLJ Programming
 open4. Database Objects
 open5. Collections
 open6. Deploying SQLJ in the JServer
 close7. Large Objects
  7.1 The Example Files and Directories
   7.2 Large Objects (LOBs)
   7.3 LONG and LONG RAW Columns
 open8. Contexts and Multithreading
 open9. Advanced Transaction Control
 open10. Performance Tuning
 open11. Combining JDBC, SQLJ, and Dynamic SQL
 openA. Java and Oracle Type Mappings
 openB. Oracle Java Utilities Reference
 openC. SQLJ in Applets, Servlets, and JavaServer Pages
  Colophon
  Index

Database > Java Programming with Oracle SQLJ > 7. Large Objects > 7.1 The Example Files and Directories

< BACKCONTINUE >

7.1 The Example Files and Directories

Throughout this chapter, you'll see several examples showing different aspects of using LOB types in SQLJ programs. The SQL*Plus script lob_user_schema.sql, which you can download from this book's web site, contains the SQL DDL statements to create the database tables, PL/SQL functions, and other items upon which this chapter's examples are based. You should download and run this script if you wish to run the example programs contained in this chapter.

Some of the examples read files, the contents of which will be stored in the database. The contents of the files become the contents of the LOBs being loaded. LOB content stored in a database doesn't need to come from a file: it can come from any valid source that you can read as a string of characters or bytes. I use files in my examples because they are the most common way of handling large blocks of data.

I use the following two LOB files in this chapter's examples:

  • textContent.txt, a text file

  • imageContent.jpg, a JPEG image file

The textContent.txt file contains a poem, written by Rajiv Sinha:

"Fortitude" Look not to strife Heed not to trite Give in not to greed Strive to attain the inner creed Learn to appreciate, aspire to comprehend Foster rectitude, be rid of all pretense Seek felicity Face adversity For remember, that in every tear shed for countless sorrow There's always the future, a resplendent tomorrow - Rajiv Sinha, 04.02.01 

The imageContent.jpg file contains an image of a waterfall, Chapel Falls, taken by Jonathan Gennick. The image, as viewed using Netscape Navigator, is shown in Figure 7-1.

Figure 7-1. The waterfall picture in imageContent.jpg
figs/sqlj_0701.gif

These files are contained in the directory sample_files, which will be created when you extract the example files from the ZIP file available on this book's web site. Within the sample_files directory, you'll find a subdirectory named retrieved. The retrieved directory will be used by the example programs to store content retrieved from the database. The example programs in this chapter all expect the path to the sample_files directory to be C:\sample_files. If you plan to run these example programs, you should either copy the sample_files directory to the location C:\sample_files, or modify the path in the programs to point to that directory's location on your disk.

< BACKCONTINUE >

Index terms contained in this section

imageContent.jpg
LOBs (large objects)
      examples of
retrieved directory
sample_files directory
textContent.txt



Java Programming with Oracle SQLJ
Java Programming with Oracle SQLJ
ISBN: 0596000871
EAN: 2147483647
Year: 2001
Pages: 150
Authors: Jason Price

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net