ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/adwrblob.htm

87 lines
6.6 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Write code that uses BLOBs" />
<meta name="abstract" content="There are a number of tasks that can be accomplished with database Binary Large Object (BLOB) columns through the Java Database Connectivity (JDBC) Application Programming Interface (API). The following topics briefly discuss these tasks and include examples on how to accomplish them." />
<meta name="description" content="There are a number of tasks that can be accomplished with database Binary Large Object (BLOB) columns through the Java Database Connectivity (JDBC) Application Programming Interface (API). The following topics briefly discuss these tasks and include examples on how to accomplish them." />
<meta name="DC.Relation" scheme="URI" content="advancdt.htm" />
<meta name="DC.Relation" scheme="URI" content="adwrclob.htm" />
<meta name="DC.Relation" scheme="URI" content="adwrdlnk.htm" />
<meta name="DC.Relation" scheme="URI" content="distinct.htm" />
<meta name="DC.Relation" scheme="URI" content="putgetblobs.htm" />
<meta name="DC.Relation" scheme="URI" content="updateblobs.htm" />
<meta name="DC.Relation" scheme="URI" content="useblobs.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="adwrblob" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Write code that uses BLOBs</title>
</head>
<body id="adwrblob"><a name="adwrblob"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Write code that uses BLOBs</h1>
<div><p>There are a number of tasks that can be accomplished with database
Binary Large Object (BLOB) columns through the Java™ Database Connectivity (JDBC) Application
Programming Interface (API). The following topics briefly discuss these tasks
and include examples on how to accomplish them.</p>
<div class="section"><h4 class="sectiontitle">Read BLOBs from the database and insert BLOBs into the database</h4><p>With
the JDBC API, there are ways to get BLOBs out of the database and ways to
put BLOBs into the database. However, there is no standardized way to create
a Blob object. This is not a problem if your database is already full of BLOBs,
but it poses a problem if you want to work with BLOBs from scratch through
JDBC. Instead of defining a constructor for the Blob and Clob interfaces of
the JDBC API, support is provided for placing BLOBs into the database and
getting them out of the database directly as other types. For example, the
setBinaryStream method can work with a database column of type Blob. <a href="putgetblobs.htm#putgetblobs">Example: BLOB</a> shows some of the common ways
that a BLOB can be put into the database or retrieved from the database.</p>
</div>
<div class="section"><h4 class="sectiontitle">Work with the Blob object API</h4><p>BLOBs are defined
in JDBC as an interface of which the various drivers provide implementations.
This interface has a series of methods that can be used to interact with the
Blob object. <a href="useblobs.htm#useblobs">Example: Use BLOBs</a> shows some of the
common tasks that can be performed using this API. Consult the JDBC Javadoc
for a complete list of available methods on the Blob object.</p>
</div>
<div class="section"><h4 class="sectiontitle">Use JDBC 3.0 support to update BLOBs</h4><p>In JDBC 3.0,
there is support for making changes to LOB objects. These changes can be stored
into BLOB columns in the database. <a href="updateblobs.htm#updateblobs">Example: Update BLOBs</a> shows
some of the tasks that can be performed with BLOB support in JDBC 3.0.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="putgetblobs.htm">Example: BLOB</a></strong><br />
This is an example of how a BLOB can be put into the database or retrieved from the database.</li>
<li class="ulchildlink"><strong><a href="updateblobs.htm">Example: Update BLOBs</a></strong><br />
This is an example of how to update BLOBs in your applications.</li>
<li class="ulchildlink"><strong><a href="useblobs.htm">Example: Use BLOBs</a></strong><br />
This is an example of how to use BLOBs in your applications.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="advancdt.htm" title="Advanced SQL3 data types give you a tremendous amount of flexibility. They are ideal for storing serialized Java objects, Extensible Markup Language (XML) documents, and multimedia data such as songs, product pictures, employee photographs, and movie clips. Java Database Connectivity (JDBC) 2.0 and higher provide support for working with these data types that are a part of the SQL99 standard.">Advanced data types</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="adwrclob.htm" title="There are a number of tasks that can be performed with database CLOB and DBCLOB columns through the Java Database Connectivity (JDBC) Application Programming Interface (API). The following topics briefly discuss these tasks and include examples on how to accomplish them.">Write code that uses CLOBs</a></div>
<div><a href="adwrdlnk.htm" title="How you work with Datalinks is dependent on what release you are working with. In JDBC 3.0, there is support to work directly with Datalink columns using the getURL and putURL methods.">Write code that uses Datalinks</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="distinct.htm" title="This is an example of how to use distinct types.">Example: Distinct types</a></div>
</div>
</div>
</body>
</html>