📄 readme.html
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
<meta name="Author" content="Jagriti">
<title>Rooms Information OCI Sample Readme</title>
<link rel="stylesheet" href="otnreadme.css" type="text/css">
</head>
<body basefont face="arial, verdana, courier" size="4" color="#FFFFFF">
<table WIDTH="100%" valign =top>
<tr>
<td VALIGN=TOP WIDTH="1000" height="2158">
<h1> <a NAME="header"></a>Rooms Information OCI Sample: Invoking Java Stored
Procedure Using OCI </h1>
<table border=0 width="296" >
<tr>
<td valign=TOP width="290" height="26">
<h2> <b>Table of Contents</b></h2>
</td>
</tr>
</table>
<ul>
<li> <a href="#intro">Overview of the Sample Application</a></li>
<li> <a href="#software">Required Software</a></li>
<li><a href="#extracting">Extracting the
Sample</a></li>
<li><a href="#prepare">Preparing and Running the Sample </a>
</li>
<li><a href="#steps">Steps in the Sample
</a></li>
<li> <a href="#description">Description of
Sample files </a></li>
</ul>
<table BORDER=0 WIDTH="770" >
<tr>
<td WIDTH="580">
<h2> <a NAME="intro"></a><b>Overview
of the Sample Application </b></h2>
</td>
<td WIDTH="176">
<center>
<a href="#header">Back
To Top</a>
</center>
</td>
</tr>
</table>
<table BORDER=0 WIDTH="82%" >
<tr>
<td valign="top">
<p><font face="Arial, Helvetica"><font color="#000000">The Oracle
Call Interface (OCI) is an application programming interface (API)
that allows applications written in C to interact with one or more
Oracle Servers. OCI gives your programs the capability to perform
the full range of database operations that are possible with Oracle9i
database, including SQL statement processing and object manipulation. </font></font>
</p>
<p><font face="Arial, Helvetica, sans-serif">This Sample demonstrates
accessing of a Java Stored Procedure from a C program using OCI.</font>
<br>
<font face="Arial, Helvetica, sans-serif">After connecting to Database,
the sample displays ten different HOTEL_ID and ROOM_TYPE combinations.
The user can choose any of the HOTEL_ID and ROOM_TYPE combination.
The Sample then invokes the Java Stored Procedure GET_ROOM_DETAILS(Hotel_Id
IN, ROOM_TYPE IN, NUM_ROOMS_AVAILABLE OUT, STANDARD_ROOM_RATE OUT). </font>
<br>
<font face="Arial, Helvetica, sans-serif">The procedure returns </font>
<br>
<font face="Arial, Helvetica, sans-serif">a) Number of Available
Rooms and </font> <br>
<font face="Arial, Helvetica, sans-serif">b) Standard Room Rate
for the given Hotel Id and Room Type combination</font>
<p><font face="Arial, Helvetica, sans-serif">The output of the procedure
is displayed on the console.</font>
</td>
</tr>
</table>
<br>
<table BORDER=0 WIDTH="770" >
<tr>
<td WIDTH="580" height="22">
<h2> <a NAME="software"></a><b>Required
Software </b></h2>
</td>
<td WIDTH="176" height="22">
<center>
<a href="#header">Back
To Top</a>
</center>
</td>
</tr>
</table>
<table width="81%" border="0" height="146">
<tr>
<td height="135">
<p><b>Calling Program</b></p>
<p>1.Oracle9i Client installed along with OCI libraries (can be downloaded
from <a href="http://otn.oracle.com/software/products/oracle9i/content.html">here</a>) </p>
<p>2. C Compiler
<p><b>Host </b></p>
<p>1. Oracle9<i>i</i> Database or higher
running SQL*Net TCP/IP listener (can be downloaded from <a href="http://otn.oracle.com/software/products/oracle9i/content.html">here</a>
) </p>
<p>2. Travel Schema needs to be loaded into the database. (can
be downloaded from <a href="http://otn.oracle.com/sample_code/tech/java/travel/travelschema.htm">here</a>)
<p>
</td>
</tr>
</table>
<table BORDER=0 WIDTH="770" >
<tr>
<td WIDTH="580">
<h2> <a NAME="extracting"></a><b>Extracting
the Sample</b></h2>
</td>
<td WIDTH="176">
<center>
<a href="#header">Back
To Top</a>
</center>
</td>
</tr>
</table>
<p><font face="Arial,Helvetica">Unzip <tt>RoomsInformationOCISample.zip</tt>
using Winzip/PKZip/equivalent in your convenient directory.</font> </p>
<p>Refer <a href="#description">Description of Sample Files</a> section
for more details.
<p>
<table BORDER=0 WIDTH="770" >
<tr>
<td WIDTH="580">
<h2> <a NAME="prepare"></a><b>Preparing and Running the Sample </b></h2>
</td>
<td WIDTH="176">
<center>
<a href="#header">Back
To Top</a>
</center>
</td>
</tr>
</table>
<table width="81%" cellspacing="5" class="TableText">
<tr>
<td width="4%" valign="top">
<p>1.</p>
</td>
<td width="96%" valign="top">
<p>Ensure that the loadjava.exe available at <oracle_home>\bin
is available in the system path, <oracle_home> refers to the
directory where Oracle9<i>i</i> client is installed.<br>
On Command Prompt, type the following command <br>
<br>
<tt>% loadjava -user travel/travel@HostName:Port:SID -verbose -force
-resolve -thin <your_directory_structure>\RoomsInformationOCISample\</tt><tt>RoomsInformationProcedure.java
</tt> <br>
Where </p>
<table width="49%" border="0">
<tr>
<td valign="top">
<p>HostName</p>
</td>
<td>
<p>= Database Machine Name (e.g. insn104a.idc.oracle.com) </p>
</td>
</tr>
<tr>
<td valign="top">
<p>Port </p>
</td>
<td>
<p>= TNS listener port (eg: 1521) </p>
</td>
</tr>
<tr>
<td valign="top">
<p>SID</p>
</td>
<td>
<p>= Database name (e.g ORCL) </p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="4%" valign="top">
<p>2.</p>
</td>
<td width="96%" valign="top">
<p>Connect to your database using the command <br>
<tt> % sqlplus travel/travel@<DatabaseConnectString> </tt>
<br>
where <DatabaseConnectString> is your TNSName</p>
</td>
</tr>
<tr>
<td width="4%" valign="top">
<p>3.</p>
</td>
<td width="96%" valign="top">
<p>Run the script RoomsInformationOCISample\config\DatabaseSetup.sql
at the SQL prompt <br>
<tt><sql> @<your_directory_structure>\RoomsInformationOCISample\config\DatabaseSetup.sql</tt>
<br>
This creates a database stored procedure GET_ROOM_DETAILS. </p>
</td>
</tr>
<tr>
<td width="4%" valign="top">
<p>4.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -