145 lines
7.6 KiB
HTML
145 lines
7.6 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="Parameter passing conventions for Java stored procedures and UDFs" />
|
||
|
<meta name="abstract" content="The following table lists how SQL data types are represented in Java stored procedures and UDFs." />
|
||
|
<meta name="description" content="The following table lists how SQL data types are represented in Java stored procedures and UDFs." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="jsqlrout.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="jsqlover.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="javaproc.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="writeudf.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="sqljjar.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="udfparam" />
|
||
|
<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>Parameter passing conventions for Java stored procedures and UDFs</title>
|
||
|
</head>
|
||
|
<body id="udfparam"><a name="udfparam"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Parameter passing conventions for Java stored procedures and UDFs</h1>
|
||
|
<div><p>The following table lists how SQL data types are represented in Java™ stored
|
||
|
procedures and UDFs.</p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th align="left" valign="top" id="d0e25">SQL data type</th>
|
||
|
<th align="left" valign="top" id="d0e27">Java parameter style JAVA</th>
|
||
|
<th align="left" valign="top" id="d0e31">Java parameter style DB2GENERAL</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" headers="d0e25 ">SMALLINT</td>
|
||
|
<td valign="top" headers="d0e27 ">short</td>
|
||
|
<td valign="top" headers="d0e31 ">short</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">INTEGER</td>
|
||
|
<td valign="top" headers="d0e27 ">int</td>
|
||
|
<td valign="top" headers="d0e31 ">int</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">BIGINT</td>
|
||
|
<td valign="top" headers="d0e27 ">long</td>
|
||
|
<td valign="top" headers="d0e31 ">long</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">DECIMAL(p,s)</td>
|
||
|
<td valign="top" headers="d0e27 ">BigDecimal</td>
|
||
|
<td valign="top" headers="d0e31 ">BigDecimal</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">NUMERIC(p,s)</td>
|
||
|
<td valign="top" headers="d0e27 ">BigDecimal</td>
|
||
|
<td valign="top" headers="d0e31 ">BigDecimal</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">REAL or FLOAT(p)</td>
|
||
|
<td valign="top" headers="d0e27 ">float</td>
|
||
|
<td valign="top" headers="d0e31 ">float</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">DOUBLE PRECISION or FLOAT or FLOAT(p)</td>
|
||
|
<td valign="top" headers="d0e27 ">double</td>
|
||
|
<td valign="top" headers="d0e31 ">double</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">CHARACTER(n)</td>
|
||
|
<td valign="top" headers="d0e27 ">String</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">CHARACTER(n) FOR BIT DATA</td>
|
||
|
<td valign="top" headers="d0e27 ">byte[]</td>
|
||
|
<td valign="top" headers="d0e31 ">com.ibm.db2.app.Blob</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">VARCHAR(n)</td>
|
||
|
<td valign="top" headers="d0e27 ">String</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">VARCHAR(n) FOR BIT DATA</td>
|
||
|
<td valign="top" headers="d0e27 ">byte[]</td>
|
||
|
<td valign="top" headers="d0e31 ">com.ibm.db2.app.Blob</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">GRAPHIC(n)</td>
|
||
|
<td valign="top" headers="d0e27 ">String</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">VARGRAPHIC(n)</td>
|
||
|
<td valign="top" headers="d0e27 ">String</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">DATE</td>
|
||
|
<td valign="top" headers="d0e27 ">Date</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">TIME</td>
|
||
|
<td valign="top" headers="d0e27 ">Time</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">TIMESTAMP</td>
|
||
|
<td valign="top" headers="d0e27 ">Timestamp</td>
|
||
|
<td valign="top" headers="d0e31 ">String</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">Indicator Variable</td>
|
||
|
<td valign="top" headers="d0e27 ">-</td>
|
||
|
<td valign="top" headers="d0e31 ">-</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">CLOB</td>
|
||
|
<td valign="top" headers="d0e27 ">-</td>
|
||
|
<td valign="top" headers="d0e31 ">com.ibm.db2.app.Clob</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">BLOB</td>
|
||
|
<td valign="top" headers="d0e27 ">-</td>
|
||
|
<td valign="top" headers="d0e31 ">com.ibm.db2.app.Blob</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">DBCLOB</td>
|
||
|
<td valign="top" headers="d0e27 ">-</td>
|
||
|
<td valign="top" headers="d0e31 ">com.ibm.db2.app.Clob</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" headers="d0e25 ">DataLink</td>
|
||
|
<td valign="top" headers="d0e27 ">-</td>
|
||
|
<td valign="top" headers="d0e31 ">-</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="jsqlrout.htm" title="Your iSeries server provides the ability to access Java programs from SQL statements and programs. This can be done using Java stored procedures and Java user-defined functions (UDFs). The iSeries server supports both the DB2 and SQLJ conventions for calling Java stored procedures and Java UDFs. Both Java stored procedures and Java UDFs can use Java classes that are stored in JAR files. The iSeries server uses stored procedures defined by the SQLJ Part 1 standard to register JAR files with the database.">Java SQL routines</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="javaproc.htm" title="When using Java to write stored procedures, you can use two possible parameter passing styles.">Java stored procedures</a></div>
|
||
|
<div><a href="writeudf.htm" title="A Java scalar function returns one value from a Java program to the database. For example, a scalar function could be created that returns the sum of two numbers.">Java user-defined scalar functions</a></div>
|
||
|
<div><a href="sqljjar.htm" title="Both Java stored procedures and Java UDFs can use Java classes that are stored in Java JAR files.">SQLJ procedures that manipulate JAR files</a></div>
|
||
|
</div>
|
||
|
<div class="reltasks"><strong>Related tasks</strong><br />
|
||
|
<div><a href="jsqlover.htm" title="You can access Java programs from SQL statements and programs. This can be done using Java stored procedures and Java user-defined functions (UDFs).">Use Java SQL routines</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|