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.