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

125 lines
9.0 KiB
HTML
Raw 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="Access databases using IBM Developer Kit for Java DB2 SQLJ support" />
<meta name="abstract" content="DB2 Structured Query Language for Java (SQLJ) support is based on the SQLJ ANSI standard. The DB2 SQLJ support is contained in the IBM Developer Kit for Java. DB2 SQLJ support allows you to create, build, and run embedded SQL for Java applications." />
<meta name="description" content="DB2 Structured Query Language for Java (SQLJ) support is based on the SQLJ ANSI standard. The DB2 SQLJ support is contained in the IBM Developer Kit for Java. DB2 SQLJ support allows you to create, build, and run embedded SQL for Java applications." />
<meta name="DC.Relation" scheme="URI" content="dbconn.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljprof.htm" />
<meta name="DC.Relation" scheme="URI" content="sqlj.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljdbpc.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljdbpp.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljpdb.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljpc.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljembd.htm" />
<meta name="DC.Relation" scheme="URI" content="sqljcr.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="sqljintr" />
<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>Access databases using IBM Developer Kit for Java DB2 SQLJ
support</title>
</head>
<body id="sqljintr"><a name="sqljintr"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Access databases using IBM Developer Kit for Java DB2 SQLJ
support</h1>
<div><p>DB2<sup>®</sup> Structured
Query Language for Java™ (SQLJ) support is based on the SQLJ
ANSI standard. The DB2 SQLJ support is contained in the IBM<sup>®</sup> Developer
Kit for Java. DB2 SQLJ support allows you to create, build, and run
embedded SQL for Java applications.</p>
<p>The SQLJ support provided by the IBM Developer Kit for Java includes
the SQLJ run-time classes, and is available in /QIBM/ProdData/Java400/ext/runtime.zip.</p>
<div class="section"><h4 class="sectiontitle">SQLJ setup</h4><p>Before you can use SQLJ in Java applications
on your server, you need to prepare your server to use SQLJ. For more information,
see <a href="sqljsetup.htm#sqljsetup">Setting up your server to use SQLJ</a>.</p>
</div>
<div class="section"><h4 class="sectiontitle">SQLJ tools</h4><p>The following tools are also included
in the SQLJ support provided by the IBM Developer Kit for Java:</p>
<ul><li><a href="sqlj.htm">The SQLJ translator, <samp class="codeph">sqlj</samp></a>,
replaces embedded SQL statements in the SQLJ program with Java source
statements and generates a serialized <a href="sqljprof.htm">profile</a> that
contains information about the SQLJ operations that are found in the SQLJ
program.</li>
<li><a href="sqljdbpc.htm">The DB2 SQLJ Profile Customizer, <samp class="codeph">db2profc</samp></a>,
precompiles the SQL statements stored in the generated profile and generates
a package in the DB2 database.</li>
<li><a href="sqljdbpp.htm">The DB2 SQLJ Profile Printer, <samp class="codeph">db2profp</samp></a>,
prints the contents of a DB2 customized profile in plain text.</li>
<li><a href="sqljpdb.htm">The SQLJ profile auditor installer, <samp class="codeph">profdb</samp></a>,
installs and uninstalls debugging class-auditors into an existing set of binary
profiles.</li>
<li><a href="sqljpc.htm">The SQLJ profile conversion tool, <samp class="codeph">profconv</samp></a>,
converts a serialized profile instance to Java class format.</li>
</ul>
<div class="note"><span class="notetitle">Note:</span> These tools must be run in the Qshell Interpreter.</div>
</div>
<div class="section"><h4 class="sectiontitle">DB2 SQLJ
restrictions</h4><p>When you create DB2 applications with SQLJ, you should be
aware of the following restrictions:</p>
<ul><li>DB2 SQLJ
support adheres to standard DB2 Universal Database™ restrictions
on issuing SQL statements.</li>
<li>The DB2 SQLJ
profile customizer should only be run on profiles associated with connections
to the local database.</li>
<li>The SQLJ Reference Implementation requires JDK 1.1, or higher. See <a href="multjdk.htm">Support for multiple Java Development Kits (JDKs)</a> for
more information on running multiple versions of the Java Development
Kit.</li>
</ul>
<p>For information on using SQL in your Java applications, see <a href="sqljembd.htm">Embed
SQL Statements in your Java application</a> and <a href="sqljcr.htm">Compile
and run SQLJ programs</a>.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="sqljprof.htm">Structured Query Language for Java profiles</a></strong><br />
Profiles are generated by the SQLJ Translator, sqlj, when you translate the SQLJ source file. Profiles are serialized binary files. That is why these files have a .ser extension. These files contain the SQL statements from the associated SQLJ source file.</li>
<li class="ulchildlink"><strong><a href="sqlj.htm">The structured query language for Java (SQLJ) translator (sqlj)</a></strong><br />
The SQLJ translator, sqlj, generates a serialized profile containing information about the SQL operations found in the SQLJ program. The SQLJ translator uses the /QIBM/ProdData/Java400/ext/translator.zip file.</li>
<li class="ulchildlink"><strong><a href="sqljdbpc.htm">Precompile SQL statements in a profile using the DB2 SQLJ profile customizer, db2profc</a></strong><br />
You can use the DB2 SQLJ Profile Customizer, db2profc, to make your Java application
work more efficiently with your database.</li>
<li class="ulchildlink"><strong><a href="sqljdbpp.htm">Print the contents of DB2 SQLJ profiles (db2profp and profp)</a></strong><br />
The DB2 SQLJ
Profile Printer, db2profp, prints the contents of a DB2 customized profile in plain text. The
Profile Printer, profp, prints the contents of profiles generated by the SQLJ
translator in plain text.</li>
<li class="ulchildlink"><strong><a href="sqljpdb.htm">SQLJ profile auditor installer (profdb)</a></strong><br />
The SQLJ profile auditor installer (profdb) installs and uninstalls debugging class-auditors. The debugging class-auditors are installed into an existing set of binary profiles. Once the debugging class-auditors are installed, all RTStatement and RTResultSet calls made during application run time are logged. They can be logged to a file or standard output. The logs can then be inspected to verify the behavior and trace errors of the application. Note that only the calls made to the underlying RTStatement and RTResultSetcall interface at run time are audited.</li>
<li class="ulchildlink"><strong><a href="sqljpc.htm">Convert a serialized profile instance to Java class format using the SQLJ profile conversion tool (profconv)</a></strong><br />
The SQLJ profile conversion tool (profconv) converts a serialized
profile instance to Java class format. The profconv tool is
needed because some browsers do not support loading a serialized object from
a resource file that is associated with an applet. Run the profconv utility
to perform the conversion.</li>
<li class="ulchildlink"><strong><a href="sqljembd.htm">Embed SQL statements in your Java application</a></strong><br />
Static SQL statements in SQLJ are in SQLJ clauses. SQLJ clauses
begin with <samp class="codeph">#sql</samp> and end with a semicolon (;) character.</li>
<li class="ulchildlink"><strong><a href="sqljcr.htm">Compile and run SQLJ programs</a></strong><br />
If you Java program has embedded SQLJ statements, you need
to follow a special procedure to compile and run it.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dbconn.htm" title="With the IBM Developer Kit for Java, your Java programs can access your database files in three ways.">Database access with the IBM Developer Kit for Java</a></div>
</div>
</div>
</body>
</html>