You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/04/08 20:51:10 UTC
[11/14] incubator-trafodion git commit: Backup checkin.
Backup checkin.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/2a4dcb02
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/2a4dcb02
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/2a4dcb02
Branch: refs/heads/master
Commit: 2a4dcb021e3536af762121d0ab39d0c9a9287f6e
Parents: 5e15be3
Author: Gunnar Tapper <gt...@esgyn.local>
Authored: Wed Apr 6 18:41:52 2016 -0600
Committer: Gunnar Tapper <gt...@esgyn.local>
Committed: Wed Apr 6 18:41:52 2016 -0600
----------------------------------------------------------------------
.../src/asciidoc/_chapters/introduction.adoc | 2 +-
.../src/asciidoc/_chapters/odb.adoc | 6 +-
.../src/asciidoc/_chapters/trickle_load.adoc | 2 +-
docs/shared/license.txt | 11 +
docs/spj_guide/pom.xml | 12 +-
.../spj_guide/src/asciidoc/_chapters/about.adoc | 31 +-
.../src/asciidoc/_chapters/create_spjs.adoc | 139 ++++++--
.../src/asciidoc/_chapters/deploy_spjs.adoc | 29 +-
.../src/asciidoc/_chapters/develop_spjs.adoc | 63 ++--
.../src/asciidoc/_chapters/execute_spjs.adoc | 44 ++-
.../src/asciidoc/_chapters/get_started.adoc | 26 +-
.../asciidoc/_chapters/grant_privileges.adoc | 9 +-
.../src/asciidoc/_chapters/introduction.adoc | 34 +-
.../_chapters/performance_troubleshooting.adoc | 20 +-
.../src/asciidoc/_chapters/sample_spjs.adoc | 330 +++++++++++--------
docs/spj_guide/src/asciidoc/index.adoc | 52 +--
.../src/images/call-statement-elements.jpg | Bin 16652 -> 33415 bytes
.../src/resources/acknowledgements.txt | 38 +++
docs/spj_guide/src/resources/source/Sales.java | 6 +-
.../src/resources/source/partData.java | 8 +-
docs/src/site/markdown/documentation.md | 63 ++--
docs/src/site/markdown/index.md | 2 +-
docs/src/site/site.xml | 13 +-
23 files changed, 561 insertions(+), 379 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/client_install/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/introduction.adoc b/docs/client_install/src/asciidoc/_chapters/introduction.adoc
index 0d88d72..91485b7 100644
--- a/docs/client_install/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/introduction.adoc
@@ -57,7 +57,7 @@ Trafodion database.
A driver that enables applications, which were developed for the Microsoft Open Database Connectivity (ODBC) application programming
interface (API) and which run on a Windows workstation, to connect to a Trafodion database.
| *Trafodion odb tool* | A multi-threaded, ODBC-based command-line tool for parallel data loading and extracting. For more information, see the
-http://trafodion.incubator.apache.org/docs/odb_user/index.html[Trafodion odb User Guide].
+http://trafodion.incubator.apache.org/docs/odb/index.html[Trafodion odb User Guide].
|===
^1^ License issues prevent us from including the ODBC Driver for Windows in this release. Contact the
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/client_install/src/asciidoc/_chapters/odb.adoc
----------------------------------------------------------------------
diff --git a/docs/client_install/src/asciidoc/_chapters/odb.adoc b/docs/client_install/src/asciidoc/_chapters/odb.adoc
index 4e397af..ff8745d 100644
--- a/docs/client_install/src/asciidoc/_chapters/odb.adoc
+++ b/docs/client_install/src/asciidoc/_chapters/odb.adoc
@@ -28,13 +28,13 @@
The odb tool runs on 64-bit Linux. On a Linux workstation, odb requires `pthread` libraries, which are usually installed by default. It also
requires the unixODBC Driver Manager to be installed and configured on the client workstation. For more information, see the
-http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
+http://trafodion.apache.org/docs/odb/index.html[_Trafodion odb User Guide_].
[[installation-instructions]]
== Installation Instructions
NOTE: Before following these installation instructions, please make sure to install and configure unixODBC on the client workstation. For more
-information, see the http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
+information, see the http://trafodion.apache.org/docs/odb/index.html[_Trafodion odb User Guide_].
You download and extract the Trafodion client package using the instructions in <<introduction-download, Download Installation Package>> above.
@@ -54,7 +54,7 @@ The command extracts these files:
* `README`
* `/bin/odb64luo` (the odb executable)
-3. You are now ready to run the odb executable. For more information, see the http://trafodion.apache.org/docs/odb_user/index.html[_Trafodion odb User Guide_].
+3. You are now ready to run the odb executable. For more information, see the http://trafodion.apache.org/docs/odb/index.html[_Trafodion odb User Guide_].
[[odb-uninstall]]
== Uninstall odb
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
----------------------------------------------------------------------
diff --git a/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc b/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
index 4991619..8ab3964 100644
--- a/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
+++ b/docs/load_transform/src/asciidoc/_chapters/trickle_load.adoc
@@ -114,7 +114,7 @@ The following odb commands/features are discussed in this guide:
* <<trickle-load-odb-extract, odb Extract>>
* <<trickle-load-odb-transform, odb Transform>>
-See the http://trafodion.incubator.apache.org/docs/odb_user/index.html[Trafodion odb User Guide]
+See the http://trafodion.incubator.apache.org/docs/odb/index.html[Trafodion odb User Guide]
for installation instructions and usage syntax for the odb tool.
The following subsections assume that you've installed odb.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/shared/license.txt
----------------------------------------------------------------------
diff --git a/docs/shared/license.txt b/docs/shared/license.txt
new file mode 100644
index 0000000..3dd96d1
--- /dev/null
+++ b/docs/shared/license.txt
@@ -0,0 +1,11 @@
+*License Statement*
+
+Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/pom.xml
----------------------------------------------------------------------
diff --git a/docs/spj_guide/pom.xml b/docs/spj_guide/pom.xml
index 8c2b3b4..9419051 100644
--- a/docs/spj_guide/pom.xml
+++ b/docs/spj_guide/pom.xml
@@ -184,8 +184,10 @@
<!-- Location of centralized stylesheet -->
<stylesheet>${basedir}/../shared/trafodion-manuals.css</stylesheet>
<project-version>${env.TRAFODION_VER}</project-version>
- <project-name>${env.PROJECT_NAME}</project-name>
- <project-logo>${env.PROJECT_LOGO}</project-logo>
+ <project-name>Trafodion</project-name>
+ <project-logo>${basedir}/../shared/trafodion-logo.jpg</project-logo>
+ <project-support>user@trafodion.incubator.apache.org</project-support>
+ <docs-url>http://trafodion.incubator.apache.org/docs</docs-url>
<build-date>${maven.build.timestamp}</build-date>
<google-analytics-account>UA-72491210-1</google-analytics-account>
</attributes>
@@ -211,8 +213,10 @@
<idprefix/>
<idseparator>-</idseparator>
<project-version>${env.TRAFODION_VER}</project-version>
- <project-name>${env.PROJECT_NAME}</project-name>
- <project-logo>${env.PROJECT_LOGO}</project-logo>
+ <project-name>Trafodion</project-name>
+ <project-logo>${basedir}/../shared/trafodion-logo.jpg</project-logo>
+ <project-support>user@trafodion.incubator.apache.org</project-support>
+ <docs-url>http://trafodion.incubator.apache.org/docs</docs-url>
<build-date>${maven.build.timestamp}</build-date>
</attributes>
</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/about.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/about.adoc b/docs/spj_guide/src/asciidoc/_chapters/about.adoc
index ebf0801..fa484cd 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/about.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/about.adoc
@@ -24,15 +24,15 @@
////
= About This Document
-This guide describes how to develop, deploy, and manage Stored Procedures in Java (SPJs) on the {project-name} database.
+This guide describes how to develop, deploy, and manage Stored Procedures in Java (SPJs) on {project-name}.
== Intended Audience
This manual is intended for application programmers who are writing and compiling Java code for stored procedures
-and for database administrators who are deploying and managing Stored Procedures in Java (SPJs) on the Trafodion
-database. The reader should know:
+and for database administrators who are deploying and managing Stored Procedures in Java (SPJs) on {project-name}.
+The reader should know:
* The Java programming language.
-* JDBC and the Trafodion JDBC Type-4 Driver.
+* JDBC and the {project-name} JDBC Type-4 Driver.
* Structured Query Language (SQL) and database terms and concepts.
Although not required, it helps to be familiar with the part of the ANSI SQL/Foundation standard called
@@ -46,18 +46,18 @@ This document is organized as follows:
|===
| Chapter | Description
| *<<introduction, Introduction>>* | Defines what an SPJ is, describes the benefits of using SPJs on the database,
-and lists steps for developing and deploying SPJs on Trafodion.
-| *<<get-started, Get Started>>* | Describes the software requirements for using SPJs on the Trafodion database.
+and lists steps for developing and deploying SPJs on {project-name}.
+| *<<get-started, Get Started>>* | Describes the software requirements for using SPJs on {project-name}.
| *<<develop-spj-methods, Develop SPJ Methods>>* | Provides guidelines for writing and compiling a Java method to be used as the
body of a stored procedure.
-| *<<deploy-spj-jar-files, Deploy SPJ JAR Files>>* | Explains how to deploy SPJ JAR files on the Trafodion database.
-| *<<create-spjs, Create SPJs>>* | Explains how to create, drop, and alter an SPJ on the Trafodion database.
+| *<<deploy-spj-jar-files, Deploy SPJ JAR Files>>* | Explains how to deploy SPJ JAR files on {project-name}.
+| *<<create-spjs, Create SPJs>>* | Explains how to create, drop, and alter an SPJ on {project-name}.
| *<<grant-privileges, Grant Privileges>>* | Explains how to grant and revoke privileges for executing SPJs on the
-Trafodion database.
-| *<<execute-spjs, Execute SPJs>>* | Explains how to execute an SPJ on the Trafodion database by using the CALL statement.
+{project-name} database.
+| *<<execute-spjs, Execute SPJs>>* | Explains how to execute an SPJ on {project-name} by using the CALL statement.
| *<<performance-and-troubleshooting, Performance and Troubleshooting>>* |
Describes how to improve and monitor the performance of SPJs and provides guidelines for troubleshooting common problems.
-| *<<sample-spjs, Appendix A: Sample SPJs>>* | Provides examples of SPJ methods that demonstrate business logic on the Trafodion database.
+| *<<sample-spjs, Appendix A: Sample SPJs>>* | Provides examples of SPJ methods that demonstrate business logic on {project-name}.
| *<<sample-database, Appendix B: Sample Database>>* | Describes the sample database on which the Sample SPJs operate.
|===
@@ -190,11 +190,8 @@ match-value [NOT] LIKE _pattern
<<<
== Comments Encouraged
-The Trafodion community encourages your comments concerning this document. We are committed to providing documentation that meets your
-needs. Send any errors found, suggestions for improvement, or compliments to:
-
-issues@trafodion.incubator.apache.org
+We encourage your comments concerning this document. We are committed to providing documentation that meets your
+needs. Send any errors found, suggestions for improvement, or compliments to {project-support}.
Include the document title and any comment, error found, or suggestion for improvement you have concerning this document.
-Or, even better, join our community and help us improve our documentation. Please refer to
-http://trafodion.incubator.apache.org/contributing_redirect.html[Trafodion Contributor Guide] for details.
+
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
index cccc674..7eb409c 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/create_spjs.adoc
@@ -23,7 +23,7 @@
[[create-spjs]]
= Create SPJs
-You can create the procedures in the Trafodion database after you've deployed the libraries for the SPJ JAR files.
+You can create the procedures in {project-name} after you've deployed the libraries for the SPJ JAR files.
See <<deploy-spj-jar-files, Deploy SPJ JAR Files>>.
The examples in this chapter are based on the sample database documented
@@ -37,16 +37,16 @@ The Create Procedure tool registers an existing Java method as a stored
procedure in Java (SPJ) within SQL.
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#create_procedure_statement[CREATE PROCEDURE]
+{docs-url}/sql_reference/index.html#create_procedure_statement[CREATE PROCEDURE]
statement including considerations and required privileges.
[[create-procedure-settings]]
=== Create Procedure Settings
Reference:
-http://trafodion.apache.org/docs/sql_reference/index.html#create_procedure_syntax[Syntax Description of CREATE PROCEDURE].
+{docs-url}/sql_reference/index.html#create_procedure_syntax[Syntax Description of CREATE PROCEDURE].
You need to determine the following settings for the CREATE PROCEDURE statement:
@@ -61,18 +61,17 @@ You need to determine the following settings for the CREATE PROCEDURE statement:
- *parameter-mode*: IN (pass data to SPJ), OUT (accept data from SPJ), or INOUT (passed data to and accepts data from SPJ). +
- *sql-identifier*: The name of the parameter passed to the SPJ. +
- *sql-datatype*: SQL data type mapped to Java data type. See <<java-parameters, Java Parameters>> for mapping,
-http://trafodion.incubator.apache.org/docs/sql_reference/index.html#data_types[Data Types] for SQL data types. +
+{docs-url}/sql_reference/index.html#data_types[Data Types] for SQL data types. +
+
Repeat for each parameter in the SPJ.
-| *external name* | `external name java-method-name [java-signature]` |
+| *external name* | `external name 'java-method-name [( java-signature )]'` |
- *java-method-name*: case-sensitive name of the SPJ method of the form `[package-name.]class-name.method-name`. The Java method must exist in a
Java class file, `_class-name_.class`, within a library registered in the database. If the class file that contains the SPJ method is part of a
package, then you must also specify the package name. +
- *java-signature*: specifies the signature of the SPJ method and consists of `([java-datatype[, java-datatype]…])`
Necessary only if you want to specify a Java wrapper class (for example, `java.lang.integer`) instead of a java
-primitive data type (for example, `int`). See
-http://trafodion.apache.org/docs/sql_reference/index.html#create_procedure_syntax[Syntax Description of CREATE PROCEDURE].
-for more information.
+primitive data type (for example, `int`). Use the `javap` utility to determine the correct values for
+java-signature.
| *library* | `library [[catalog-name.]schema-name.]library-name` |
- *catalog*: must be `trafodion`. +
- *schema-name*: the schema the library is associated with. +
@@ -87,9 +86,9 @@ the stored procedure. +
+
See <<understand-external-security, Understand External Security>> for more information.
| *language java* | `language java` | Must be set specified the procedure is an SPJ rather than a UDF.
-Compare: http://trafodion.incubator.apache.org/docs/sql_reference/index.html#create_function_statement[CREATE FUNCTION].
+Compare: {docs-url}/sql_reference/index.html#create_function_statement[CREATE FUNCTION].
| *parameter style java* | `parameter style java` | Must be set specified the procedure is an SPJ rather than a UDF.
-Compare: http://trafodion.incubator.apache.org/docs/sql_reference/index.html#create_function_statement[CREATE FUNCTION].
+Compare: {docs-url}/sql_reference/index.html#create_function_statement[CREATE FUNCTION].
| *_sql access_* |
`no sql` \| +
`contains sql` (default) \| +
@@ -114,15 +113,16 @@ you want the stored procedure to inherit the transaction from the calling applic
`deterministic` \| +
`not deterministic` (default) |
Whether the SPJ always returns the same values for out and inout parameters for a given set of argument values
-(`deterministic`) or does not return the same values (`not deterministic`). `deterministic` means that Trafodion
+(`deterministic`) or does not return the same values (`not deterministic`). `deterministic` means that {project-name}
can cache the result to improve performance.
| *_isolation_* |
`isolate` (default) \| +
`no isolate` |
The SPJ executes either in the environment of the database server (`no isolate`) or in an isolated environment
-(`isolate`, the default option). Trafodion allows both options but always executes the SPJ in the UDR server process (`isolate`).
+(`isolate`, the default option). {project-name} allows both options but always executes the SPJ in the UDR server process (`isolate`).
|===
+<<<
Consider the following method in the `Sales.java` class:
[source, java]
@@ -130,6 +130,7 @@ Consider the following method in the `Sales.java` class:
include::{sourcedir}/totalPrice.java[totalPrice procedure source code]
----
+<<<
The CREATE PROCEDURE attributes for `totalPrice` are defined as follows:
[cols="15%,40%,45%",options="header",]
@@ -144,7 +145,7 @@ Possible values are: `economy`, `standard`, or `nextday`. `VARCHAR(10)` is a goo
The SPJ uses an input price to calculate to total price including taxes and shipping cost.
Therefore, `INOUT` is the appropriate choice. Given that the `_qty_` argument is NUMERIC(18), then this argument should be too. The precision choice fits the the
type of calculation being peformed.
-| *external name* | `EXTERNAL NAME Sales.totalPrice` | The class name is `Sales`. The procedure name is `totalPrice`.
+| *external name* | `EXTERNAL NAME 'Sales.totalPrice'` | The class name is `Sales`. The procedure name is `totalPrice`.
| *library* | `library trafodion.sales.sales` | The library name was defined using the CREATE LIBRARY statement.
See the example in <<create-a-library, Create a Library>>.
| *external security* | `invoker`^1^ | Use the privileges of the SPJ invoker.
@@ -159,6 +160,7 @@ See the example in <<create-a-library, Create a Library>>.
^1^ Definition represents default value.
+<<<
Using the information above, you create the new procedure as follows:
[source, sql]
@@ -194,6 +196,98 @@ CREATE PROCEDURE trafodion.sales.totalprice( IN qty NUMERIC (18),
;
----
+<<<
+To understand how to define `java-signature`, consider the following method in the
+`Inventory.java` class.
+
+[source,java]
+----
+public static void supplierInfo( BigDecimal suppNum
+ , String[] suppName
+ , String[] streetAddr
+ , String[] cityName
+ , String[] stateName
+ , String[] postCode
+ ) throws SQLException
+{
+ Connection conn =
+ DriverManager.getConnection( "jdbc:default:connection" ) ;
+
+ PreparedStatement getSupplier =
+ conn.prepareStatement( "SELECT suppname, street, city, "
+ + " state, postcode "
+ + "FROM trafodion.invent.supplier "
+ + "WHERE suppnum = ?"
+ ) ;
+
+ getSupplier.setBigDecimal( 1, suppNum ) ;
+ ResultSet rs = getSupplier.executeQuery() ;
+ rs.next() ;
+
+ suppName[0] = rs.getString( 1 ) ;
+ streetAddr[0] = rs.getString( 2 ) ;
+ cityName[0] = rs.getString( 3 ) ;
+ stateName[0] = rs.getString( 4 ) ;
+ postCode[0] = rs.getString( 5 ) ;
+
+ rs.close() ;
+ conn.close() ;
+}
+----
+
+<<<
+The CREATE PROCEDURE attributes for `supplierInfo` are defined as follows:
+
+[cols="20%,85%",options="header"]
+|===
+| Attribute | Definition
+| *procedure-ref* | `trafodion.invent.supplierinfo`
+| *sql-parameter-1* | `IN suppnum NUMERIC(4)`
+| *sql-parameter-2* | `OUT suppname CHARACTER(18)`
+| *sql-parameter-3* | `OUT address CHARACTER(22)`
+| *sql-parameter-4* | `OUT city CHARACTER(14)`
+| *sql-parameter-5* | `OUT state CHARACTER(12)`
+| *sql-parameter-6* | `OUT zipcode CHARACTER(10)`
+| *external name* |
+`EXTERNAL NAME 'Inventory.supplierInfo ( java.math.BigDecimal, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String[] )'`
+| *library* | `LIBRARY trafodion.invent.inventory`
+| *external security* | `invoker`^1^ +
+ +
+Choice depends on your security requirements, you can select `definer` instead.
+For more information, see <<understand-external-security, Understand External Security>>.
+| *language java* | `LANGUAGE JAVA`
+| *parameter style java* | `PARAMETER STYLE JAVA`
+| *_sql access_* | `READS SQL DATA`
+| *dynamic result sets* | `DYNAMIC RESULT SETS 0`^1^
+| *_transaction_* | `TRANSACTION REQUIRED`^1^
+| *_determinism_* | `NOT DETERMINISTIC`^1^
+| *_isolation_* | `ISOLATE`^1^
+|===
+
+^1^ Definition represents default value. Not included in the CREATE PROCEDURE example.
+
+<<<
+You can use the `javap` utility to inspect the attributes of the method.
+
+*Example*
+
+```
+$ javap Inventory.class
+Compiled from "Inventory.java"
+public class Inventory {
+ public Inventory();
+ public static void supplierInfo(java.math.BigDecimal, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String[]) throws java.sql.SQLException;
+ public static void supplyQuantities(int[], int[], int[]) throws java.sql.SQLException;
+ public static void partLocations(int, int, java.sql.ResultSet[], java.sql.ResultSet[]) throws java.sql.SQLException;
+}
+```
+
+The entry for `supplierInfo` method shows the attributes that should be used for `java-signature`.
+
+You don't specify for `java.sql.ResultSet[]` attributes; these are handled via the `DYNAMIC RESULTS SET` attribute
+in the `CREATE PROCEDURE` statement.
+
+<<<
[[understand-external-security]]
== Understand External Security
@@ -239,7 +333,7 @@ execute the SPJ without requiring privileges to the underlying database objects.
To set the external security of an SPJ, see <<create-a-procedure, Create a Procedure>>.
-
+<<<
[[drop-a-procedure]]
== Drop a Procedure
@@ -249,12 +343,12 @@ a schema-level privilege to other users or roles.
For example, if the schema owner granted you privileges to drop all objects in the schema,
you could drop procedures. For more information, see the GRANT SCHEMA statement in the
-http://trafodion.apache.org/docs/sql_reference/index.html#grant_statement[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html#grant_statement[{project-name} SQL Reference Manual]
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#drop_procedure_statement[DROP PROCEDURE]
+{docs-url}/sql_reference/index.html#drop_procedure_statement[DROP PROCEDURE]
statement including considerations and required privileges.
*Example*
@@ -286,7 +380,8 @@ SQL> DROP PROCEDURE trafodion.sales.totalprice ;
SQL>
```
-[[display-procedures-and-their-properties}}
+<<<
+[[display-procedures-and-their-properties]]
== Display Procedures and Their Properties
In the trafci command-line interface, use the SHOW PROCEDURES command to
@@ -324,10 +419,10 @@ SQL>
----
For more information about trafci, see the
-http://trafodion.apache.org/docs/command_interface/index.html[Trafodion Command Interface Guide].
+{docs-url}/command_interface/index.html[{project-name} Command Interface Guide].
////
-20160323: Trafodion does not yet support the ALTER LIBRARY command.
+20160323: {project-name} does not yet support the ALTER LIBRARY command.
[[altering-an-spj-and-its-java-bytecode]]
=== Altering an SPJ and Its Java Bytecode
@@ -338,7 +433,7 @@ files that are packaged in the SPJ JAR file.
Suppose that you want to update the Java bytecode of an SPJ without
changing the class name, method name, or Java signature of the SPJ method.
In this case, you would alter the library by selecting the updated JAR file
-to upload to the Trafodion database, replacing the previous JAR file for the
+to upload to {project-name}, replacing the previous JAR file for the
library. For more information, see <<alter-a-library, Alter a Library>>.
NOTE: You are prevented from uploading a JAR file that is already in use
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
index 7a1a263..1f7ad25 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/deploy_spjs.adoc
@@ -24,7 +24,7 @@
= Deploy SPJ JAR Files
After developing and packaging the SPJ code into JAR files, you must
-move the JAR files from the client workstation to the Trafodion database.
+move the JAR files from the client workstation to {project-name}.
You can upload a SPJ JAR file and create a library by using
the CREATE LIBRARY command in the Trafodion Command Interface (trafci).
@@ -32,20 +32,21 @@ the CREATE LIBRARY command in the Trafodion Command Interface (trafci).
Libraries provide greater security for JAR files because libraries are
database objects whose access is controlled using standard SQL security.
-Deploying a JAR file to a Trafodion instance requires creating a library,
+Deploying a JAR file to a {project-name} instance requires creating a library,
and users must have the required privileges for creating libraries in order
to deploy JAR files.
The examples in this chapter are based on the sample database
documented in <<b-sample-database, Appendix B: Sample Database>>.
+<<<
[[create-a-library]]
== Create a Library
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
+{docs-url}/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
statement including considerations and required privileges.
NOTE: You must copy the jar file to the same directory on all the nodes in the cluster before running the CREATE LIBRARY statement.
@@ -89,7 +90,8 @@ $
```
$ pdsh $MY_NODES -x $HOSTNAME mkdir $HOME/trafodion-spjs
```
-
++
+<<<
3. Multi-node cluster only: Copy the jar file to all nodes in the cluster.
+
*Example*
@@ -135,9 +137,9 @@ SQL>
When you alter a library, you can change the underlying JAR file of the library.
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#alter_library_statement[ALTER LIBRARY]
+{docs-url}/sql_reference/index.html#alter_library_statement[ALTER LIBRARY]
statement including considerations and required privileges.
*Example*
@@ -184,17 +186,17 @@ SQL>
```
////
+<<<
[[drop-a-library]]
== Drop a Library
Dropping a library removes the library from the schema in the database
-and removes the library's underlying JAR file from the Trafodion
-database.
+and removes the library's underlying JAR file from {project-name}.
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#drop_library_statement[DROP LIBRARY]
+{docs-url}/sql_reference/index.html#drop_library_statement[DROP LIBRARY]
statement including considerations and required privileges.
*Example*
@@ -226,13 +228,14 @@ SQL> DROP LIBRARY trafodion.sales.saleslib ;
SQL>
```
+<<<
[[display-libraries]]
== Display Libraries
Refer to the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual]
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual]
for full documentation of the
-http://trafodion.apache.org/docs/sql_reference/index.html#get_statement[GET]
+{docs-url}/sql_reference/index.html#get_statement[GET]
statement.
Use the `GET libraries [ in schema [ catalog-name.] schema-name ] statement in trafci to
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
index 0b13648..acd0248 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/develop_spjs.adoc
@@ -49,7 +49,7 @@ public static void myMethodName ( java-parameter-list )
==== Public Access and Static Modifiers
The Java method must be defined as `public` and `static`. If a method is
-`private` or `protected`, then Trafodion is unable to find the Java
+`private` or `protected`, then {project-name} is unable to find the Java
method when you try to register the SPJ and returns an error. The Java
method must be defined as `static` so that the method can be invoked
without having to instantiate its class.
@@ -69,6 +69,7 @@ the parameter types in the Java signature must correspond to the SQL
parameters of the stored procedure that you are planning to create. For
type mappings, see the table below.
+<<<
[[table-1]]
.Mapping of Java Data Types to SQL Data Types
@@ -97,9 +98,9 @@ NUMERIC (including numeric with a precision greater than eighteen)^2^ | java.mat
| DOUBLE PRECISION | double or java.lang.double^4^
|===
-1. Trafodion stores PIC X as a CHAR data type.
-2. Numeric data types of SQL parameters must be signed, which is the default in Trafodion.
-3. Trafodion stores PIC S9 as a DECIMAL or NUMERIC data type.
+1. {project-name} stores PIC X as a CHAR data type.
+2. Numeric data types of SQL parameters must be signed, which is the default in {project-name}.
+3. {project-name} stores PIC S9 as a DECIMAL or NUMERIC data type.
4. By default, the SQL data type maps to a Java primitive type. The SQL data type maps to a Java wrapper class
only if you specify the wrapper class in the Java signature of the external name clause.
@@ -108,6 +109,7 @@ Output parameters in the Java signature must be arrays (for example,
the array at index 0. For more information, see
<<returning-output-values-from-the-java-method, Returning Output Values From the Java Method>>.
+<<<
[[returning-output-values-from-the-java-method]]
=== Returning Output Values From the Java Method
@@ -158,6 +160,7 @@ for each returned value. For example, the `supplierInfo()` method returns
a supplier's name, address, city, state, and post code, each as a single
string in an output parameter:
+<<<
The `supplyQuantities()` method returns an average quantity, a minimum
quantity, and a maximum quantity to separate output parameters of the
integer type:
@@ -167,12 +170,13 @@ integer type:
public static void supplyQuantities( int[] avgQty
, int[] minQty
, int[] maxQty
- )
+ ) throws SQLException
{
...
-throws SQLException
+}
+
----
For more information about the SPJ examples, see
@@ -189,13 +193,13 @@ type of the SPJ method must map to an SQL data type. See
The SQL data type must then map to a compatible data type in the calling
application. For the client application programming interfaces (APIs) that
support SPJs and for cross-references to the appropriate manuals for type
-mappings between Trafodion SQL and each API, see
+mappings between {project-name} SQL and each API, see
<<execute-spjs, Execute SPJs>> below.
[[returning-stored-procedure-result-sets]]
=== Returning Stored Procedure Result Sets
-The Trafodion database engine supports SPJs that return stored procedure
+{project-name} supports SPJs that return stored procedure
result sets. A stored procedure result set is a cursor that is left open
after the SPJ method executes (that is, after the CALL statement
executes successfully). After the CALL statement executes successfully,
@@ -267,13 +271,14 @@ to process them.
An SPJ method can return result sets that contain any data types, except
large object (LOB) data. An SPJ method can return a holdable or
-updatable cursor as a result set. However, Trafodion SQL does not expose
+updatable cursor as a result set. However, {project-name} SQL does not expose
those attributes in the calling application. An SPJ method can return a
ResultSet object that is a stored procedure result set acquired from a
nested CALL statement executed by the SPJ method. However, you are
discouraged from nesting CALL statements in SPJ methods. For more
information, see <<nested-java-method-invocations, Nested Java Method Invocations>>.
+<<<
If an SPJ method returns multiple ResultSet objects, the database engine
sorts the collection of valid result sets in chronological order
according to when the underlying SQL statements were executed. If the
@@ -283,7 +288,7 @@ database engine discards the other result sets and returns a warning to
the calling application.
When an SPJ method returns a ResultSet object through a
-`java.sql.ResultSet[]` parameter, Trafodion SQL exposes the underlying rows
+`java.sql.ResultSet[]` parameter, {project-name} SQL exposes the underlying rows
of data as an SQL cursor in the calling application.
If a returned result set is a scrollable cursor, all underlying rows are
@@ -379,17 +384,18 @@ method should be packaged in the same JAR file as the SPJ method. For
more information, see
<<compiling-and-packaging-java-classes, Compiling and Packaging Java Classes>>.
+<<<
[[accessing-a-trafodion-database]]
-== Accessing a Trafodion Database
+== Accessing {project-name}
-SPJ methods that access a Trafodion database must be from a Java class
+SPJ methods that access {project-name} must be from a Java class
that uses JDBC method calls. Follow these guidelines when writing an SPJ
-method that accesses a Trafodion database:
+method that accesses {project-name}:
[[use-of-java.sql.connection-objects]]
=== Use of java.sql.Connection Objects
-The Trafodion database engine supports a default connection in an SPJ
+{project-name} supports a default connection in an SPJ
execution environment, which has a data source URL of
`"jdbc:default:connection"`. For example:
@@ -400,13 +406,13 @@ Connection conn =
----
`java.sql.Connection` objects that use the `"jdbc:default:connection"` URL
-are portable to the Trafodion platform from other database management
+are portable to {project-name} from other database management
systems (DBMSs).
[[closing-default-connections]]
==== Closing Default Connections
-The Trafodion database engine controls default connections in the SPJ
+{project-name} controls default connections in the SPJ
environment and closes default connections when they are no longer
needed. Therefore, you do not need to use the `close()` method in an SPJ
method to explicitly close a default connection when the connection is
@@ -481,20 +487,21 @@ Connection conn =
DriverManager.getConnection( "jdbc:default:connection", props ) ;
----
+<<<
[[using-jdbc-method-calls]]
=== Using JDBC Method Calls
-The Trafodion platform uses a JDBC Type-4 driver internally to execute
+{project-name} uses a JDBC Type-4 driver internally to execute
the SQL statements inside an SPJ method. To enable an SPJ to perform SQL
-operations on a Trafodion database, use JDBC method calls in the SPJ
+operations on a {project-name} database, use JDBC method calls in the SPJ
method. The JDBC method calls must be supported by the JDBC Type-4
-driver on the Trafodion platform.
+driver on {project-name}.
-For example, if you want the SPJ method to operate on a Trafodion database,
-use the JDBC API that is supported by Trafodion.
+For example, if you want the SPJ method to operate on a {project-name} database,
+use the JDBC API that is supported by {project-name}.
NOTE: You do not have to explicitly load the JDBC driver before
-establishing a connection to the Trafodion database. The database engine
+establishing a connection to {project-name}. The database engine
automatically loads the JDBC driver when the SPJ is called.
Here is an example of an SPJ method, `adjustSalary()`, that uses JDBC
@@ -548,7 +555,7 @@ For other examples of SPJ methods, see <<sample-spjs, Appendix A: Sample SPJs>>.
In an SPJ method, you can refer to SQL database objects by specifying
three-part ANSI names that include the catalog, schema, and object name.
For more information about database object names, see the
-http://trafodion.incubator.apache.org/docs/sql_reference/index.hmtl[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.hmtl[{project-name} SQL Reference Manual].
The database engine propagates the names of the catalog and schema where
the SPJ is registered to the SPJ environment. By default, database
@@ -702,6 +709,7 @@ security is set to definer, any user who has the execute privilege on
the stored procedure can call the procedure using the privileges of the
user who created the stored procedure.
+<<<
For example, suppose that DB USERADMINUSER creates a stored procedure
named GETDEFINER using the `getUser(`) method and sets the external
security to definer. If the database user named GTAPPER, who has the
@@ -746,6 +754,7 @@ The SESSION_USER function returns the name of the authenticated database
user who started the session and invoked the function, regardless of the
external security setting of the stored procedure.
+<<<
For example, suppose that DB USERADMINUSER creates a stored procedure named
GETSESSIONUSER using the `getSessionUser()` method and sets the external
security to definer. If the database user named GTAPPER, who has the EXECUTE
@@ -775,11 +784,12 @@ For more information about external security, see
[[exception-handling]]
=== Exception Handling
-For SPJ methods that access a Trafodion database, no special code is
+For SPJ methods that access {project-name}, no special code is
necessary for handling exceptions. If an SQL operation fails inside an
SPJ, the error message associated with the failure is returned to the
application that issues the CALL statement.
+<<<
[[handling-java-exceptions]]
== Handling Java Exceptions
@@ -833,13 +843,14 @@ For more information about the numMonthlyOrders() method, see the
<<monthlyorders-procedure, MONTHLYORDERS Procedure>>.
For information about specific SQL errors, see the
-http://trafodion.incubator.apache.org/docs/messages_guide/index.html[Trafodion Messages Manual], which lists
+{docs-url}/messages_guide/index.html[{project-name} Messages Manual], which lists
the SQLCODE, SQLSTATE, message text, and cause-effect-recovery information for all SQL errors.
+<<<
[[compiling-and-packaging-java-classes]]
== Compiling and Packaging Java Classes
-On the Trafodion database, the class files of SPJ methods must be
+On {project-name}, the class files of SPJ methods must be
packaged in Java archive (JAR) files. After writing an SPJ method,
compile the Java source file of the SPJ method into Java bytecode and
package the Java bytecode in a JAR file. A Java method that you register
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc b/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
index 0bd5ae5..5100227 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/execute_spjs.adoc
@@ -24,8 +24,8 @@
= Execute SPJs
This chapter describes how to execute SPJs by using the CALL statement
-and assumes that you have already registered the SPJs in the Trafodion
-database and that you have granted privileges to execute the SPJs to the
+and assumes that you have already registered the SPJs in {project-name}
+and that you have granted privileges to execute the SPJs to the
appropriate database users. For information, see
<<deploy-spj-jar-files, Deploy SPJ JAR Files>>
and <<create-spjs, Create SPJs>>.
@@ -46,8 +46,7 @@ GTA 20160321: Triggers aren't supported yet. Uncommented as needed.
////
The CALL statement invokes an SPJ in the database. You can issue a CALL
-statement from any of these applications or interfaces supported by the
-Trafodion platform:
+statement from any of these applications or interfaces supported by {project-name}:
* trafci command-line interface or script file
* JDBC Type-4 client applications
@@ -59,6 +58,7 @@ use a CALL statement in a trigger but not inside a compound statement or
with rowsets. The SPJ that you use in a trigger must not have any OUT or
INOUT parameters or return any result sets.
+<<<
[[required-privileges-for-calling-an-spj]]
== Required Privileges for Calling an SPJ
@@ -98,7 +98,7 @@ automatically initiates a transaction if there is no active transaction.
[[using-transaction-control-statements-or-methods]]
==== Using Transaction Control Statements or Methods
-If you select Yes for the Transaction Required attribute when creating a
+If you select `Yes` for the Transaction Required attribute when creating a
stored procedure, then you should not use transaction control statements (or
equivalent JDBC transaction methods) in the SPJ method. Transaction
control statements include COMMIT WORK and ROLLBACK WORK, and the
@@ -133,7 +133,7 @@ WORK statement in the calling application to commit the transaction when
the CALL statement succeeds, and use the ROLLBACK WORK statement to roll
back the transaction when the CALL statement fails. For more information
about transaction management, see the
-http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual].
[[no-transaction-required]]
=== No Transaction Required
@@ -169,7 +169,8 @@ attribute to NO TRANSACTION REQUIRED when creating the stored procedure.
For more information, see the Transaction Required attribute in
<<create-a-procedure, Create a Procedure>>.
-If you select No for the Transaction Required attribute when creating a
+<<<
+If you select `No` for the Transaction Required attribute when creating a
stored procedure and if the SPJ method creates a JDBC default
connection, then that connection has autocommit enabled by default. You
can either use the autocommit transactions or disable autocommit
@@ -180,7 +181,7 @@ work where needed.
[[multithreading]]
== Multithreading
-The Trafodion database engine manages a single thread of execution within
+{project-name} manages a single thread of execution within
an SPJ environment, even if the application that issues a CALL statement
is a multi-threaded Java application.
@@ -198,8 +199,9 @@ and its arguments in a CALL statement, as shown in the figure below.
image:{images}/call-statement-elements.jpg[CALL Statement Elements]
For the syntax of the CALL statement, see the
-http://trafodion.apache.org/docs/sql_reference/index.html#call_statement[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html#call_statement[{project-name} SQL Reference Manual].
+<<<
[[specifying-the-name-of-the-spj]]
=== Specifying the Name of the SPJ
@@ -309,12 +311,13 @@ that table below:
|===
For more information about SQL value expressions, see the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual].
Because an INOUT parameter passes a single value to and accepts a single
value from an SPJ, you can specify only dynamic parameters for INOUT
parameter arguments in a CALL statement.
+<<<
[[output-parameter-arguments]]
==== Output Parameter Arguments
@@ -351,6 +354,7 @@ result sets in different applications, see:
* <<returning-result-sets-in-an-odbc-client, Returning Result Sets in an ODBC Client>>
* <<returning-result-sets-in-a-jdbc-client, Returning Result Sets in a JDBC Client>>
+<<<
[[calling-spjs-in-trafci]]
== Calling SPJs in trafci
@@ -368,7 +372,7 @@ CALL statement. The procedure call changes the value of a named
parameter that you use as an OUT or INOUT parameter.
For more information about named and unnamed parameters, see the
-http://trafodion.incubator.apache.org/docs/command_interface/index.html[Trafodion Command Interface Guide].
+{docs-url}/command_interface/index.html[{project-name} Command Interface Guide].
[[using-named-parameters]]
=== Using Named Parameters
@@ -411,6 +415,7 @@ SQL> SHOW PARAM
p 253.97
----
+<<<
[[using-unnamed-parameters]]
=== Using Unnamed Parameters
@@ -464,6 +469,7 @@ PRICE
--- SQL operation complete.
----
+<<<
[[returning-result-sets-in-trafci]]
=== Returning Result Sets in trafci
@@ -504,6 +510,7 @@ ORDERNUM PARTNUM UNIT_PRICE QTY_ORDERED PARTDESC
For other result set examples, see <<sample-spjs, Appendix A: Sample SPJs>>.
+<<<
[[calling-spjs-from-an-odbc-client-application]]
== Calling SPJs From an ODBC Client Application
@@ -550,10 +557,11 @@ once written.
For more information about the ODBC client applications,
see the
-http://trafodion.incubator.apache.org/docs/odbc_reference/index.html[Trafodion ODBC Driver Programmer's Reference].
+{docs-url}/odbc_reference/index.html[{project-name} ODBC Driver Programmer's Reference].
////
+<<<
[[returning-result-sets-in-an-odbc-client-application]]
=== Returning Result Sets in an ODBC Client Application
@@ -562,7 +570,7 @@ sets returned by a CALL statement. The `SQLMoreResults()` function closes
the current result set and moves processing to the next available result
set.
-NOTE: The Trafodion ODBC API does not currently support interleaved result set
+NOTE: The {project-name} ODBC API does not currently support interleaved result set
processing, where more than one returned result set can be open at a
time.
@@ -608,6 +616,7 @@ while ( ( rc = SQLMoreResults( s ) ) != SQL_NO_DATA )
}
----
+<<<
[[calling-spjs-from-a-jdbc-client-application]]
== Calling SPJs From a JDBC Client Application
@@ -649,12 +658,13 @@ BigDecimal z = stmt.getBigDecimal( 3 ) ; // Retrieve the value of the OUT parame
GTA 20160321: The JDBC T4 manual does not exist yet. Enable this line
once written.
-For more information about the Trafodion JDBC Type 4 driver and mappings of SQL to JDBC data types,
+For more information about the {project-name} JDBC Type 4 driver and mappings of SQL to JDBC data types,
see the
-http://trafodion.incubator.apache.org/docs/jdbct4_reference/index.html[Trafodion JDBC Type 4 Driver Programmer's Reference].
+{docs-url}/jdbct4_reference/index.html[{project-name} JDBC Type 4 Driver Programmer's Reference].
////
+<<<
[[returning-result-sets-in-a-jdbc-client-application]]
=== Returning Result Sets in a JDBC Client Application
@@ -744,7 +754,7 @@ are useful as triggered actions because they can help you encapsulate
and enforce rules in the database. For more information about the
benefits of using SPJs, see <<benefits-of-spjs, Benefits of SPJs>>
-Trafodion SQL supports a CALL statement in a trigger provided that the
+{project-name} SQL supports a CALL statement in a trigger provided that the
SPJ in the CALL statement does not have any OUT or INOUT parameters or
return any result sets. For more information, see
<<returning-output-values-from-the-java-method, Returning Output Values From the Java Method>>,
@@ -765,5 +775,5 @@ FOR EACH STATEMENT REFERENCING NEW as newqty
----
For information about the CREATE TRIGGER syntax, see the
-http://trafodion.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual].
////
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc b/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
index a8e5c2b..eeb4756 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/get_started.adoc
@@ -23,9 +23,9 @@
[[get-started]]
= Get Started
-Before you can start using SPJs on the Trafodion platform, verify that
-you have the required software installed on the client workstation. The
-Trafodion platform is delivered to you ready to use and pre-configured
+Before you can start using SPJs on {project-name}, verify that
+you have the required software installed on the client workstation.
+{project-name} is delivered to you ready to use and pre-configured
with the software required to support SPJs.
[[required-client-software]]
@@ -41,12 +41,13 @@ http://www.oracle.com/technetwork/java/index.html
The version of the JDK that you download and use on the client
workstation should be the same as or lower than the Java version running
-on the Trafodion database. To check the Java version that is running in
-the Trafodion database, use this approach:
+on {project-name}. To check the Java version that is running in
+{project-name}, use this approach:
-* Launch `trafci` on the Trafodion platform, and run the `LOCALHOST` or `lh java -version` command.
+* Launch `trafci` on {project-name}, and run the `LOCALHOST` or `lh java -version` command.
(To use the on-platform trafci client, see the
-http://trafodion.apache.org/docs/command_interface/index.html[Trafodion Command Interface Guide.)
+{docs-url}/command_interface/index.html[{project-name} Command Interface Guide].
++
For example:
+
```
@@ -59,14 +60,15 @@ Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode)
SQL>
```
+
-In this example, the returned Java version indicates that the Trafodion
+In this example, the returned Java version indicates that the {project-name}
instance supports Java SE 6 or JDK 6 (1.6.0), or earlier versions of the
JDK.
-NOTE: If you plan to install the Trafodion JDBC Type-4 Driver on the client
+NOTE: If you plan to install the {project-name} JDBC Type-4 Driver on the client
workstation, you must have JDK 6 (1.6.0) or higher installed on the
client workstation.
+<<<
[[recommended-client-software]]
== Recommended Client Software
@@ -76,15 +78,15 @@ client workstation.
`trafci` is a command-line interface in which you can run SQL statements,
such as GRANT PROCEDURE and CALL statements, interactively or from
script files. To install `trafci` on a client workstation, see the
-http://trafodion.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide].
+{docs-url}/client_install/index.html[{project-name} Client Installation Guide].
[[hp-jdbc-type-4-driver]]
=== HP JDBC Type 4 Driver
-If you plan to use `trafci`, you must have a compatible version of the Trafodion
+If you plan to use `trafci`, you must have a compatible version of the {project-name}
JDBC Type-4 Driver installed on the client workstation.
To install the JDBC Type-4 driver on the client workstation, see the
-http://trafodion.apache.org/docs/client_install/index.html[Trafodion Client Installation Guide].
+{docs-url}/client_install/index.html[{project-name} Client Installation Guide].
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc b/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
index 9b1ed05..f369931 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/grant_privileges.adoc
@@ -28,7 +28,7 @@ granting privileges to specified database users and roles.
The schema in which an SPJ is registered is the unit of ownership. The
database user who creates the schema is the owner of that schema and all
-objects associated with it. In a Trafodion database, the schema owner
+objects associated with it. In {project-name}, the schema owner
automatically has these privileges:
* Ability to create and drop SPJs in the schema. You can create SPJs in
@@ -54,6 +54,7 @@ OPTION privileges to other users and roles. For more information, see:
To display the current ownership and privileges, see
<<display-procedures-and-their-properties, Display Procedures and Their Properties>>.
+<<<
[[granting-execute-privileges-on-an-spj]]
== Granting Execute Privileges on an SPJ
@@ -62,7 +63,7 @@ WITH GRANT OPTION privileges on an SPJ to specific database users and
roles. In a GRANT statement, specify ALL PRIVILEGES to grant the EXECUTE
privilege on an SPJ. For the syntax of the GRANT PROCEDURE and GRANT
statements, see the
-http://trafodion.incubator.apache.org/docs/sql_reference/index.html[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html[{project-name} SQL Reference Manual].
If you own the SPJ, then you can grant the EXECUTE and WITH GRANT OPTION
privileges on the SPJ to any database user or role. If you are not the
@@ -171,7 +172,7 @@ SELECT, UPDATE, DELETE, and INSERT, indicate which types of privileges
are required for the referenced database objects.
For the syntax of the GRANT statement, see the
-http://trafodion.apache.org/docs/sql_reference/index.html#grant_statement[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html#grant_statement[{project-name} SQL Reference Manual].
[[revoking-execute-privileges-on-an-spj]]
== Revoking Execute Privileges on an SPJ
@@ -181,7 +182,7 @@ WITH GRANT OPTION privilege on an SPJ from specific database users or
roles. In a REVOKE statement, specify ALL PRIVILEGES to revoke the
EXECUTE privilege on an SPJ. For the syntax of the REVOKE PROCEDURE and
REVOKE statements, see the
-http://trafodion.apache.org/docs/sql_reference/index.html#revoke_statement[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html#revoke_statement[{project-name} SQL Reference Manual].
If you own the SPJ, then you can revoke the EXECUTE and WITH GRANT OPTION
privileges on the SPJ from any database user or role to whom you granted
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc b/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
index 83fa291..d877409 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/introduction.adoc
@@ -23,8 +23,8 @@
[[introduction]]
= Introduction
-This chapter introduces stored procedures in Java (SPJs) in a Trafodion
-database and covers these topics:
+This chapter introduces stored procedures in Java (SPJs) in {project-name}
+and covers these topics:
[[what-is-an-spj]]
== What Is an SPJ?
@@ -38,27 +38,26 @@ function, which returns a value directly to the calling application, a
stored procedure returns each output value to a dynamic parameter in its
parameter list or returns a set of values to a result set array.
-The Trafodion database supports stored procedures written in the Java
-programming language. The Trafodion implementation of stored procedures
+{project-name} supports stored procedures written in the Java
+programming language. The {project-name} implementation of stored procedures
complies mostly, unless otherwise specified, with SQL/JRT (Java Routines
and Types), which extends the ANSI SQL/Foundation standard. A stored
procedure in Java (SPJ) is a Java method contained in a Java archive
-(JAR) file on the Trafodion platform, registered in the database, and
+(JAR) file on {project-name}, registered in the database, and
executed by the database engine when a client application issues a CALL
statement.
The body of a stored procedure consists of a public, static Java method
that returns void. These Java methods, called _SPJ methods_, are
-contained in classes within JAR files on the cluster hosting the
-Trafodion database.
+contained in classes within JAR files on the cluster hosting {project-name}.
An SPJ method must be registered as a stored procedure in the database before a
client application can execute it with a CALL statement. You upload the SPJ to
-the cluster where the Trafodion database is running
+the cluster where {project-name} is running
and then you register the SPJ as a library object using the
-http://trafodion.apache.org/docs/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
+{docs-url}/sql_reference/index.html#create_library_statement[CREATE LIBRARY]
statement. Next, you register the library object using the
-http://trafodion.apache.org/docs/sql_reference/index.html#create_procedure_statement[CREATE PROCEDURE]
+{docs-url}/sql_reference/index.html#create_procedure_statement[CREATE PROCEDURE]
statement.
[[benefits-of-spjs]]
@@ -77,7 +76,7 @@ the database. SPJs offer these advantages:
=== Java Methods Callable From SQL
With support for SPJs, Java methods are callable from any client
-application that connects to the Trafodion platform. For example, you can
+application that connects to {project-name}. For example, you can
invoke the same SPJ method from JDBC client applications and ODBC client
applications. By using the database engine to invoke Java methods, you
can extend the functionality of the database and share business logic
@@ -131,16 +130,16 @@ Java class files for SPJs once and deploy them anywhere.
Because SPJ methods are written in Java, and SPJs conform to the ANSI
SQL standard, SPJs are portable across different database servers. With
minimal changes to SPJ methods, you can port existing SPJ JAR files from
-another database server to a Trafodion platform and register the methods
-as stored procedures in a Trafodion database. You can also port client
-applications that call SPJs in other databases to Trafodion SQL with
+another database server to {project-name} and register the methods
+as stored procedures in a {project-name} database. You can also port client
+applications that call SPJs in other databases to {project-name} SQL with
minimal changes to the CALL statements in the application.
<<<
[[use-spjs]]
== Use SPJs
-To use SPJs in a Trafodion database:
+To use SPJs in {project-name}:
1. Verify that you have the required software installed on the client
workstation. See <<get-started, Get Started>>.
@@ -217,7 +216,7 @@ $
+
For details, see <<develop-spj-methods, Develop SPJ Methods>>.
-3. Deploy the SPJ JAR file on the Trafodion platform by creating a
+3. Deploy the SPJ JAR file on {project-name} by creating a
library object for the JAR file in one of the database schemas. For
details, see <<Deploy-spj-jar-files, Deploy SPJ JAR Files>>.
@@ -242,7 +241,8 @@ WITH GRANT OPTION ;
----
+
For details, see <<grant-privileges, Grant Privileges>>.
-
++
+<<<
6. Execute an SPJ by using a CALL statement in a client application.
For example, you can issue a CALL statement in an trafci session, as
shown below, or in a JDBC or ODBC client application:
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/2a4dcb02/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
----------------------------------------------------------------------
diff --git a/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc b/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
index d0e1e2f..ed5b4e0 100644
--- a/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
+++ b/docs/spj_guide/src/asciidoc/_chapters/performance_troubleshooting.adoc
@@ -24,7 +24,7 @@
= Performance and Troubleshooting
This chapter describes how to improve and monitor the performance of
-SPJs on the Trafodion platform and provides guidelines for
+SPJs on {project-name} and provides guidelines for
troubleshooting common problems:
* <<troubleshooting-common-problems, Troubleshooting Common Problems>>
@@ -39,7 +39,7 @@ follow these guidelines:
* Note the SQLCODE or SQLSTATE value of the error messages and locate
the information in the
-http://trafodion.apache.org/docs/messages_guide/index.html[[Trafodion Messages Manual]],
+{docs-url}/messages_guide/index.html[[{project-name} Messages Manual]],
which provides cause, effect, and recovery information for all SQL errors.
* Check that the user has the appropriate permissions to create or call
@@ -73,16 +73,15 @@ SPJ method is not trying to insert more than one array element into a
`java.sql.ResultSets[]` array. For more information, see
<<returning-stored-procedure-result-sets, Returning Stored Procedure Result Sets>>.
-* To identify Java-related errors, execute the SPJ method outside the
-Trafodion database by invoking the Java method directly in a Java
-application that you run on a client workstation, using the Trafodion
-JDBC Type-4 driver to connect to the Trafodion platform.
+* To identify Java-related errors, execute the SPJ method outside {project-name}
+by invoking the Java method directly in a Java application that you run on a
+client workstation, using the {project-name} JDBC Type-4 driver to connect to {project-name}.
* If you are using JDBC tracing and logging, then follow these guidelines:
** Execute the SPJ method outside the database by invoking the Java
method directly from a Java application that you run on a client
-workstation, using the Trafodion JDBC Type-4 driver to connect to the Trafodion
+workstation, using the {project-name} JDBC Type-4 driver to connect to the {project-name}
platform.
** Verify that the file directory specified in the `T4LogFile` property
@@ -91,7 +90,7 @@ exists on the client workstation and that you have write access to it.
[[performance-tip]]
== Performance Tip
-To ensure the optimal performance of SPJs on the Trafodion platform,
+To ensure the optimal performance of SPJs on {project-name},
avoid nesting CALL statements in an SPJ method, which wastes resources
and might diminish performance. For more information, see
<<nested-java-method-invocations, Nested Java Method Invocations>>.
@@ -192,7 +191,7 @@ SQL>
The EXPLAIN statement generates and displays all the columns of the
result table of the EXPLAIN function. For the syntax of the EXPLAIN
statement, see the
-http://trafodion.apache.org/docs/sql_reference/index.html#explain_statement[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html#explain_statement[{project-name} SQL Reference Manual].
[[using-the-explain-function]]
=== Using the EXPLAIN Function
@@ -230,6 +229,7 @@ For a CALL statement, the OPERATOR column of the result table contains a
row named CALL. The DESCRIPTION column contains special token pairs for
the CALL operator. For descriptions of the token pairs, see this table:
+<<<
.Token Pairs Description
[cols="30%,60%,10%", options="header"]
|===
@@ -261,5 +261,5 @@ DEFINER. For more information, see <<understand-external-security, Understand Ex
|===
For the syntax of the EXPLAIN function, see the
-http://trafodion.apache.org/docs/sql_reference/index.html#explain_statement[Trafodion SQL Reference Manual].
+{docs-url}/sql_reference/index.html#explain_statement[{project-name} SQL Reference Manual].