欢迎光临
我们一直在努力

ylyp什么意思p28412269_112040_WINNT.zip

/* Copyright (c) 1999, 2014, Oracle and/or its affiliates.
All rights reserved.*/

This file is the README file for sample programs in the JPub demo
directory. It specifies the steps required to run each of the
programs in this directory, and their expected behavior.
All demos use the scott/tiger schema.

0. First, check your environment setup
**************************************

0.1 Test the database setup: TestInstallCreateTable.java

This JDBC program creates a table named ‘SALES’ in the
schema for user SCOTT. This table is used in the other
TestInstall program as well.

The following commands will compile and run this program:

% javac TestInstallCreateTable.java
% java TestInstallCreateTable

Expected output on the screen is:

SALES table created

and the table should be present in the scott/tiger database account.

A related file is TestInstall.sql. This file contains a SQL script
to create the same ‘SALES’ table via SQL*Plus.

0.2 Test the JDBC setup: TestInstallJDBC.java
This is another program that verifies your JDBC setup.
It uses the SALES table created by the previous program,
TestInstallCreateTable.java, in user SCOTT’s schema.

The following commands will compile and run this sample:

% javac TestInstallJDBC.java
% java TestInstallJDBC

Expected output to the screen is:

Hello JDBC!

0.3 Modify the entries in "connect.properties" and "jpub.properties"
to reflect the logon strings used for your JDBC driver and database
account.

The demo programs in the demo directory use information contained
in the file "connect.properties" to establish a runtime connection.
In addition, the JPublisher utility uses information contained in
the file "jpub.properties" to establish a connection.

0.4 Make sure the JPub utility can be invoked from the command line,
and produces the expected output:

% jpub
JPub: Java Object Type Publisher, version 10.1.0.1.0 Production
Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.

JPub generates Java or SQLJ source code for the following SQL entities:
object types, collection types, and packages.

Invocation:
jpub <options>

The following option is required:
-user=<username>/<password>

Other options are:
-input=<input file>
Types and packages to be processed by JPub may be listed in the -input file
The contents of the -input file may be as simple as:
SQL Person
SQL Employee

-sql=<sql entity list>
Types and packages to be processed by JPub may also be listed using the -sql option
For example, -sql=a,b:c,d:e:f is equivalent to the -input file entries:
SQL a
SQL b AS c
SQL d GENERATE e AS f

The following options determine which Java types are generated
to represent SQL user-defined, numeric, lob, and other types:
-usertypes=oracle|jdbc
-numbertypes=objectjdbc|jdbc|bigdecimal|oracle
-lobtypes=oracle|jdbc
-builtintypes=jdbc|oracle
-addtypemap=<sql opaque type>:<java wrapper class>
-addtypemap=<plsql type>:<java>:<sql type>:<sql2plsql>:<plsql2sql>
-plsqlmap=true|false|always – control generation of PL/SQL wrappers
-plsqlfile=<file for generated PL/SQL wrapper code>
-plsqlpackage=<package for generated PL/SQL code>

-case=mixed|same|lower|upper
-dir=<base directory for generated Java files>
-driver=<JDBC-Driver>
(default: oracle.jdbc.driver.OracleDriver)
-encoding=<Java encoding of -input file and generated files>
-gensubclass=true|force|call-super|false
-methods=none|named|all
-omit_schema_names
-package=<package-name>
-access=public|protected|package
-compatible=ORAData|CustomDatum
-context=generated|DefaultContext
-serializable=true|false
-tostring=true|false
-props=<properties file from which to load options>
-url=<JDBC-URL>
(default: jdbc:oracle:oci8:@)

If this expected output is not obtained, please check your environment
settings for PATH and CLASSPATH:
* PATH should include the directory ORACLE_HOME/bin
* CLASSPATH should include the file ORACLE_HOME/sqlj/lib/translator.jar

In addition, a JDK 1.2-compatible Java compiler (assumed to be javac)
and the java interpreter (assumed java) must be correctly installed.

If this expected output is not obtained, please check your environment
settings, as described in section 0.2.

1. Next, run the sample programs in this directory.
***************************************************

Four rational number examples are provided, demonstrating three different
ways to do the same thing:

* "MyRationalC" uses a rational number object type. The class JPub
generates has no methods other than "get" and "set" accessor methods.
The user extends the class JPub generates and adds additional methods.

The other examples involve client wrapper methods that invoke server-side
PL/SQL methods:

* "RationalO" uses a rational number object type, with a few methods for
manipulating the rational numbers.

* "RationalP" puts the rational number methods in a PL/SQL package. A
rational number type without methods provides arguments to the PL/SQL
methods in the package.

* "MyRationalO" shows another example of extending a JPub-generated
rational number class.

* "MyRationalO8i" shows how to use the JPublisher 8i compatibility
mode. This may be useful if you wrote an application with JPublisher
version 8.1.7 or earlier, and do not want to change you application
to take advantage of the changed APIs in JPublisher release 9i.

These examples are kept deliberately simple, so as not to obscure the
principles involved.

This directory contains the following files for demos 1.1 through 1.7.
Additional files are listed below with the demo that uses it.

README.txt the file you are now reading

Rational.sql SQL script to create the object types Rational and
RationalO and the PL/SQL package RationalP

MyRationalC.java Source code for the class MyRationalC

TestMyRationalC.java Test program to demonstrate use of the
class MyRationalC, a hand-written class that
extends the JPub-generated class JPubRationalC

TestRationalO.java Test program to demonstrate use of the class RationalO,
which JPub generates to represent the RationalO type

TestRationalP.java Test program to demonstrate use of the class RationalP,
which JPub generates to represent the PL/SQL package
RationalP. This test also uses the Rational class,
which JPub generates to represent the Rational type

TestMyRationalO.java Test program to demonstrate use of the class
MyRationalO, a hand-written class that extends the
JPub-generated class JPubRationalO.

MyRationalO.java Source code for the class MyRationalO

MyRationalO8i.java Source code for the class MyRationalO8i

connect.properties used by the test programs when they connect

jpub.properties used by JPub when it connects

1.1 Run the Rational.sql SQL script to create the object types and
the PL/SQL package used in these examples. (replace scott/tiger
with your username/password values).

% sqlplus scott/tiger @Rational.sql

1.2 Run the MyRationalC test. In this test, JPub generates
JPubRationalC.java.
This class represents the database object type RationalO.
The hand-written class MyRationalC.java extends JPubRationalC
by adding methods such as toString() and plus().

% jpub -props=jpub.properties -sql=RationalO:JPubRat

赞(0)
未经允许不得转载:上海聚慕医疗器械有限公司 » ylyp什么意思p28412269_112040_WINNT.zip

登录

找回密码

注册