/* 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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
p20406239_112040_Linux-x86-64.zip (65个子文件)
PatchSearch.xml 5KB
20406239
README.txt 21B
custom
post.txt 1KB
README.html 33KB
files
jdbc
lib
ojdbc5dms_g.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 50KB
OracleDatabaseMetaData.class 132KB
ojdbc6_g.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 59KB
OracleDatabaseMetaData.class 196KB
ojdbc5.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 25KB
OracleDatabaseMetaData.class 43KB
ojdbc5_g.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 50KB
OracleDatabaseMetaData.class 132KB
ojdbc6.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 27KB
OracleDatabaseMetaData.class 53KB
ojdbc6dms.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 31KB
OracleDatabaseMetaData.class 141KB
ojdbc5dms.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 29KB
OracleDatabaseMetaData.class 114KB
ojdbc6dms_g.jar
oracle
jdbc
driver
OracleSql$1.class 2KB
OracleSql$ParseMode.class 1KB
OracleSql.class 59KB
OracleDatabaseMetaData.class 196KB
javavm
admin
jox.o 1.49MB
classes.bin 103.88MB
install
jvmpsu.sql 2KB
jvmpsupi.sql 1KB
jvmsec5.sql 9KB
initsqlj.sql 4KB
jvmpsupdii.sql 1KB
jvmpsupdi.sql 1KB
jvmpsui.sql 2KB
initdbj.sql 91KB
jvmrm.sql 8KB
jvmpsupii.sql 2KB
lib
jce.jar 88KB
sunjce_provider.jar 166KB
security
cacerts 77KB
java.security 14KB
rdbms
admin
initsqlj.sql 4KB
initdbj.sql 91KB
sqlj
lib
sqljutl.jar 33KB
sqlpatch
20406239
postdeinstall.sql 5KB
postinstall.sql 5KB
jpub
sql
sqljutl2.sql 2KB
demo
README.txt 34KB
lib
libjavavm11.a 24.69MB
etc
config
deploy.xml 22B
actions.xml 8KB
inventory.xml 3KB
xml
GenericActions.xml 5KB
ShiphomeDirectoryStructure.xml 2KB
共 65 条
- 1
资源评论
- wind2005vip2022-12-01好东西,谢谢!
tradow
- 粉丝: 1
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于SpringBoot Mybatis-Plus TypeScript的微服务多租户SaaS管理快速开发框架 .zip
- 论文复现:QA-GNN: Reasoning with Language Models and Knowledge
- ipp(intel-oneAPI)下载地址.txt
- 基于spring-boot dubbox搭建的java分布式系统的前端管理.zip
- VLC+Qt demoVLC+Qt demo
- 海彪&龙梅子 - 寂寞的人伤心的歌 (DJ版) [mqms2].ogg
- 530springboot + vue 旅游管理系统.zip(可运行源码+数据库文件+文档)
- 基于SpringBoot + Thymeleaf + Layui + Apache Shiro 的后台管理系统 .zip
- 表1:长江大学文理学院课外学分申请表.et
- base.apk
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功