/* 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:JPubRationalC:MyRationalC -mapping=jdbc -methods=none
% javac JPubRationalC.java MyRationalC.java TestMyRationalC.java
% java TestMyRationalC
The expected output is:
gcd: 5
real value: 0.5
没有合适的资源?快使用搜索试试~ 我知道了~
p19791364_112040_Linux-x86-64.zip
共391个文件
o:272个
xml:32个
sql:32个
需积分: 10 8 下载量 57 浏览量
2019-02-27
17:34:23
上传
评论
收藏 71.4MB ZIP 举报
温馨提示
oraclep19791364_112040_Linux-x86-64.zip补丁
资源推荐
资源详情
资源评论
收起资源包目录
p19791364_112040_Linux-x86-64.zip (391个子文件)
libjavavm11.a 24.58MB
classes.bin 103.84MB
diskmon.bin 905KB
cacerts 78KB
DBMsg.class 191KB
Job.class 105KB
DBMsgID.class 97KB
JobSQLGenerator.class 24KB
ProgramSQLGenerator.class 10KB
WindowSQLGenerator.class 10KB
ScheduleSQLGenerator.class 9KB
BaselineSQLGenerator.class 8KB
ChainStepsSQLGenerator.class 6KB
ClassSQLGenerator.class 5KB
WindowGroupSQLGenerator.class 5KB
ChainRulesSQLGenerator.class 5KB
ChainSQLGenerator.class 5KB
BeanUtils.class 3KB
DBObjectSQLGenerator.class 2KB
README.html 52KB
ordimimg.jar 565KB
sunjce_provider.jar 166KB
ordim.jar 116KB
jce.jar 86KB
sqljutl.jar 33KB
lxinst 4.69MB
ins_rdbms.mk 41KB
oraus.msb 1.06MB
oraus.msb 1.06MB
oraus.msg 4.75MB
oraus.msg 4.75MB
kcl.o 1.87MB
kcl.o 1.87MB
jox.o 1.49MB
jox.o 1.45MB
jox.o 1.45MB
jox.o 1.45MB
jox.o 1.45MB
kcb.o 1.07MB
kcb.o 1.07MB
kcb.o 1.07MB
kdlw.o 1.02MB
kjbr.o 940KB
kjbr.o 940KB
kcbz.o 876KB
kcbz.o 876KB
ktu.o 842KB
kjb.o 815KB
kjb.o 815KB
krvx.o 807KB
kjfc.o 752KB
ksfd.o 717KB
ksfd.o 716KB
kjbm.o 716KB
kjbm.o 716KB
kjbm.o 713KB
kjbm.o 713KB
kewr.o 711KB
kkzl.o 686KB
kcfis.o 680KB
kcfis.o 677KB
knlogc.o 642KB
lpxfsm.o 640KB
knlc.o 613KB
ktsp.o 613KB
rfrdb.o 612KB
ktsp.o 610KB
kfd.o 598KB
kfd.o 597KB
krf.o 596KB
krvxb.o 579KB
krvxb.o 578KB
kff.o 568KB
krd.o 556KB
kql.o 544KB
krmk4.o 518KB
kfdp.o 509KB
kfdp.o 509KB
diskmon.o 505KB
atb.o 492KB
atb.o 492KB
kjbl.o 462KB
kjbl.o 461KB
krmk5.o 459KB
dgl.o 441KB
kxdam.o 437KB
kgnfs.o 434KB
kgnfs.o 434KB
ksp.o 413KB
ksk.o 409KB
kwqic.o 403KB
knals.o 391KB
kjdr.o 387KB
kjdr.o 387KB
krvrd.o 383KB
kdu.o 376KB
krbb.o 370KB
kfg.o 370KB
kfg.o 370KB
knalf.o 367KB
共 391 条
- 1
- 2
- 3
- 4
资源评论
Import_admin
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功