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

87 lines
6.5 KiB
HTML

<?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 CLOBs" />
<meta name="abstract" content="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." />
<meta name="description" content="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." />
<meta name="DC.Relation" scheme="URI" content="advancdt.htm" />
<meta name="DC.Relation" scheme="URI" content="adwrblob.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="putgetclobs.htm" />
<meta name="DC.Relation" scheme="URI" content="updateclobs.htm" />
<meta name="DC.Relation" scheme="URI" content="useclobs.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="adwrclob" />
<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 CLOBs</title>
</head>
<body id="adwrclob"><a name="adwrclob"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Write code that uses CLOBs</h1>
<div><p>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.</p>
<div class="section"><h4 class="sectiontitle">Read CLOBs from the database and insert CLOBs into the database</h4><p>With
the JDBC API, there are ways to get CLOBs out of the database and ways to
put CLOBs into the database. However, there is no standardized way to create
a Clob object. This is not a problem if your database is already full of CLOBs,
but it poses a problem if you want to work with CLOBs from scratch through
JDBC. Instead of defining a constructor for the Blob and Clob interfaces of
the JDBC API, support is provided for placing CLOBs into the database and
getting them out of the database directly as other types. For example, the
setCharacterStream method can work with a database column of type Clob. <a href="putgetclobs.htm#putgetclobs">Example: CLOB</a> shows some of the common ways
that a CLOB can be put into the database or retrieved from the database.</p>
</div>
<div class="section"><h4 class="sectiontitle">Work with the Clob object API</h4><p>CLOBs 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
Clob object. This <a href="useclobs.htm">example</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 Clob object.</p>
</div>
<div class="section"><h4 class="sectiontitle">Use JDBC 3.0 support to update CLOBs</h4><p>In JDBC 3.0,
there is support for making changes to LOB objects. These changes can be stored
into CLOB columns in the database. This <a href="updateclobs.htm">example</a> shows
some of the tasks that can be performed with CLOB support in JDBC 3.0.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="putgetclobs.htm">Example: CLOB</a></strong><br />
This is an example of how a CLOB can be put into the database or retrieved from the database.</li>
<li class="ulchildlink"><strong><a href="updateclobs.htm">Example: Update CLOBs</a></strong><br />
This is an example of how to update CLOBs in your applications.</li>
<li class="ulchildlink"><strong><a href="useclobs.htm">Example: Use CLOBs</a></strong><br />
This is an example of how to use CLOBs 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="adwrblob.htm" title="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.">Write code that uses BLOBs</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>