/* 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
没有合适的资源?快使用搜索试试~ 我知道了~
p26635834_112040_Linux-x86-64.zip
共103个文件
class:64个
sql:17个
xml:7个
需积分: 14 12 下载量 46 浏览量
2019-02-27
17:35:41
上传
评论 1
收藏 40.49MB ZIP 举报
温馨提示
p26635834_112040_Linux-x86-64.zip补丁
资源推荐
资源详情
资源评论
收起资源包目录
p26635834_112040_Linux-x86-64.zip (103个子文件)
libjavavm11.a 24.7MB
classes.bin 104.94MB
cacerts 69KB
OracleDatabaseMetaData.class 196KB
OracleDatabaseMetaData.class 196KB
T4CConnection.class 149KB
T4CConnection.class 149KB
OracleDatabaseMetaData.class 141KB
OracleDatabaseMetaData.class 132KB
OracleDatabaseMetaData.class 132KB
T4CConnection.class 123KB
T4CConnection.class 122KB
OracleDatabaseMetaData.class 114KB
T4CConnection.class 73KB
T4CConnection.class 67KB
OracleSql.class 59KB
OracleSql.class 59KB
T4CConnection.class 57KB
T4CConnection.class 53KB
OracleDatabaseMetaData.class 53KB
OracleTypeCOLLECTION.class 51KB
OracleTypeCOLLECTION.class 51KB
OracleSql.class 50KB
OracleSql.class 50KB
OracleDatabaseMetaData.class 43KB
OracleTypeCOLLECTION.class 43KB
OracleTypeCOLLECTION.class 43KB
OracleSql.class 31KB
OracleSql.class 29KB
OracleSql.class 27KB
OracleSql.class 25KB
OracleTypeCOLLECTION.class 21KB
OracleTypeCOLLECTION.class 20KB
OracleTypeCOLLECTION.class 18KB
OracleTypeCOLLECTION.class 18KB
AddrResolution.class 13KB
AddrResolution.class 13KB
AddrResolution.class 12KB
AddrResolution.class 12KB
AddrResolution.class 11KB
AddrResolution.class 11KB
AddrResolution.class 10KB
AddrResolution.class 10KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
OracleSql$ParseMode.class 1KB
T4CConnection$1.class 982B
T4CConnection$1.class 982B
T4CConnection$1.class 982B
T4CConnection$1.class 982B
T4CConnection$1.class 879B
T4CConnection$1.class 879B
T4CConnection$1.class 879B
T4CConnection$1.class 879B
README.html 47KB
sunjce_provider.jar 210KB
jce.jar 102KB
sqljutl.jar 33KB
local_policy.jar 3KB
US_export_policy.jar 2KB
jox.o 1.49MB
java.security 31KB
initdbj.sql 91KB
initdbj.sql 91KB
jvmsec5.sql 9KB
jvmrm.sql 8KB
postdeinstall.sql 5KB
postdeinstall.sql 5KB
postinstall.sql 5KB
postinstall.sql 5KB
initsqlj.sql 4KB
initsqlj.sql 4KB
jvmpsui.sql 4KB
jvmpsupii.sql 3KB
jvmpsupdii.sql 3KB
sqljutl2.sql 2KB
jvmpsu.sql 2KB
jvmpsupdi.sql 1KB
jvmpsupi.sql 1KB
README.txt 34KB
post.txt 1KB
README.txt 21B
actions.xml 13KB
PatchSearch.xml 8KB
inventory.xml 5KB
GenericActions.xml 5KB
patchmd.xml 3KB
共 103 条
- 1
- 2
资源评论
Import_admin
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功