Tutorial Downloads .com


SQL/MX Programming Manual for Java

This Java tutorial covers the details of SQL/MX Programming Manual for Java.This manual explains how to use embedded SQL in Java (SQLJ) programs in HP NonStop™ SQL/MX. In SQL/MX, an SQLJ program uses embedded SQL/MX statements to access HP NonStop SQL/MP and SQL/MX databases.

HP NonStop SQL/MX Programming Manual for Java.
What’s New in This Manual xiii
Manual Information xiii
New and Changed Information xiii
About This Manual xv
Audience xv
Organization xv
Examples in This Manual xvi
Related Documentation xvii
Notation Conventions xxi
1. Introduction
What Is SQLJ? 1-1
Benefits of SQLJ 1-1
SQLJ Compared With Embedded SQL in C or COBOL 1-2
SQLJ Compared With JDBC 1-4
SQLJ and JDBC Interoperability 1-5
SQLJ Versus JDBC Performance 1-6
Startup Performance 1-6
Steady-State Performance 1-7
When to Choose SQLJ Versus JDBC 1-7
Steps of Developing and Executing an SQLJ Program 1-8
Processing an SQLJ Program 1-9
Default Processing Without Module Definition Files 1-9
Processing With Module Definition Files 1-17
Executing an SQLJ Program 1-20
Static SQLJ Execution 1-20
Dynamic SQLJ Execution 1-21
Execution Scenarios 1-22
2. Getting Started
Software Requirements 2-1
SQLJ Product File 2-1
NonStop Server for Java 2-2
JDBC/MX Driver 2-2
Verifying Software Versions 2-2
Verifying the SQLJ Product 2-2
Verifying the NonStop Server for Java 2-3
Verifying the JDBC/MX Driver 2-3
Configuring the Java Environment 2-4
Setting the JREHOME Environment Variable 2-4
Setting the Class Path 2-4
Establishing Java Security 2-6
3. SQLJ Programming
Basic Elements of an SQLJ Program 3-1
SQLJ Source File 3-1
SQLJ Clause 3-1
Comments 3-3
Naming Restrictions and Reserved Words 3-4
Code Initialization 3-4
Specifying the Java Package of an SQLJ Program 3-4
Importing Java Packages 3-5
Registering and Loading the JDBC/MX Driver 3-6
Connection Contexts 3-8
Implicit Connection Contexts 3-8
Explicit Connection Contexts 3-8
Execution Contexts 3-20
Implicit Execution Contexts 3-20
Explicit Execution Contexts 3-20
Execution Context Methods 3-22
Multithreading 3-23
Coding a Multithreaded SQLJ Program 3-23
Nonblocking JDBC/MX (Nowait SQL) 3-26
Host Variables and Expressions 3-27
Input and Output Modes 3-27
Host Variables 3-28
Host Expressions 3-30
3. SQLJ Programming (continued)
Data Type Support 3-32
Input Assignability 3-32
Output Assignability 3-35
Optimal Data Type Mappings 3-37
Date-Time Data Types 3-38
Interval Data Types 3-38
Floating-Point Data Types 3-39
Character String Data Types 3-40
Character String Literals 3-45
Using Special Characters in Character String Literals 3-45
Using Hexadecimal Values in Character String Literals 3-46
Specifying the Character Set Prefix 3-46
Specifying National Character String Literals 3-47
Iterators and Result Sets 3-48
Positioned Iterator 3-48
Named Iterator 3-51
Positioned Iterator Versus Named Iterator 3-54
Positioned UPDATE and DELETE Statements 3-55
Passing Iterators as Parameters 3-56
Converting Between SQLJ Iterators and JDBC Result Sets 3-56
Calling Stored Procedures in Java 3-59
Handling Exception Conditions 3-60
SQL Exceptions 3-60
Java Exceptions 3-62
SQL Warnings 3-63
Chained Exceptions and Warnings 3-64
Lost Open Error (8574) 3-66
4. SQL/MX Programming Considerations
Static and Dynamic SQL 4-1
Customized and Default Run Time 4-1
Static and Dynamic Execution Scenarios 4-2
Causes of Dynamic Execution 4-2
4. SQL/MX Programming Considerations (continued)
CONTROL Statements 4-6
ANSI Compliance and Portability 4-6
Static and Dynamic CONTROL Statements 4-6
Static CONTROL Statements 4-7
Dynamic CONTROL Statements 4-8
Placement of the CONTROL Statements 4-10
SET TABLE TIMEOUT Statement 4-11
ANSI Compliance and Portability 4-11
Scope of the SET TABLE TIMEOUT Statement 4-11
Placement of the SET TABLE TIMEOUT Statement 4-11
MODULE Directive 4-12
ANSI Compliance and Portability 4-12
Placement of the MODULE Directive 4-12
Connection Context of the MODULE Directive 4-13
Catalog and Schema of the Module Name 4-13
External Qualification of the Module Name 4-14
Delimited Identifiers in the Module Name 4-14
System-Defined Module Name 4-15
DECLARE and SET Statements for Object Name Qualification 4-16
ANSI Compliance and Portability 4-16
DECLARE Statements for Static SQL 4-16
SET Statements for Dynamic SQL 4-18
Precedence of Object Name Qualification 4-19
Name Resolution 4-20
Table and View Name References 4-20
Precedence of Object Name Qualification 4-22
Compile-Time Name Resolution for SQL/MP Objects 4-23
Late Name Resolution for SQL/MP Objects 4-23
Distributed Database Considerations 4-24
RDF Considerations 4-24
Similarity Checks and Automatic Recompilation 4-26
Similarity Check 4-26
Automatic Recompilation 4-29
Recommended Recompilation Settings for OLTP Programs 4-30
4. SQL/MX Programming Considerations (continued)
Data Definition Language (DDL) Statements 4-32
Placement of DDL Statements 4-32
Scope of DDL Statements 4-32
Using Distributed Database Statements in an SQLJ Program 4-33
Distributing SQL/MX Objects From an SQLJ Program 4-35
Automatic Hash Partitioning From an SQLJ Program 4-37
Using SQL/MP Alias Statements in an SQLJ Program 4-38
ANSI Compliance and Portability 4-39
Placement of the UPDATE STATISTICS Statement 4-39
Scope of the UPDATE STATISTICS Statement 4-39
Long-Running UPDATE STATISTICS Operations and TMF Errors 4-40
Publish/Subscribe Services 4-40
Transaction Management 4-41
Transaction Control Statements 4-41
Steps for Ensuring Data Consistency 4-42
Setting Attributes for Transactions 4-43
Starting a Transaction 4-46
Processing Database Changes 4-46
Testing for Errors 4-46
Committing Database Changes if No Errors Occur 4-47
Undoing Database Changes if an Error Occurs 4-47
5. Processing SQLJ Programs
Commands for Processing an SQLJ Program 5-1
Commands for Processing Without Module Definition Files 5-2
Commands for Processing With Module Definition Files 5-4
Using Command-Line Options 5-6
Prefixes, Options, and Flags 5-6
Properties File 5-7
Precedence of Option Settings 5-9
5. Processing SQLJ Programs (continued)
SQLJ Translator Command Line 5-10
Command-Line Syntax 5-10
Summary of SQLJ Command-Line Options 5-11
Options for Output Files and Directories 5-18
Options for the Command Line Only 5-19
Options for Reporting and Line Mapping 5-20
Options for the SQLJ Translator 5-21
Option for Missing or Unavailable Database Objects 5-23
Options for the Java Compiler 5-24
Options for the SQLJ Customizer 5-26
Options for Module Management 5-28
Options for Object Name Qualification 5-30
Options for the SQL/MX Compiler 5-32
Java Compiler Command Line 5-33
Command-Line Syntax 5-33
Example—javac 5-33
mxCompileUserModule Command Line 5-34
Command-Line Syntax 5-34
MXCMP Environment Variable 5-36
Examples—mxCompileUserModule 5-37
SQL/MX Compiler Command Line 5-38
Command-Line Syntax 5-38
Example—mxcmp 5-39
jar Tool Command Line 5-40
Command-Line Syntax 5-40
Example—jar 5-40
SQLJ Run-Time Command Line 5-41
Command-Line Syntax 5-41
Example—SQLJ Run-Time Command Line 5-42
ProfilePrinter Tool 5-42
Command-Line Syntax 5-42
Example—ProfilePrinter 5-42
Interpreting the ProfilePrinter Output 5-42
Displaying Query Execution Plans 5-46
Displaying the Query Execution Plan of One Statement 5-46
Displaying the Query Execution Plans of All Statements 5-47
6. Program and Module Management
Program Files 6-1
Customized SQLJ Program Files 6-2
Noncustomized SQLJ Program Files 6-4
Packaging the Program in a JAR File 6-5
Guidelines for Generating a JAR File 6-6
Customizing Profiles in a JAR File 6-7
Avoiding Possible Naming Conflicts 6-10
Managing Program Files 6-11
Managing Modules 6-11
Module Management Naming 6-12
How Modules Are Named 6-12
Effect of Module Management Naming 6-15
Targeting 6-15
Versioning 6-17
Grouping 6-20
A. SQLJ Syntax
SQLJ Clause A-1
Connection Declaration Clause A-1
Iterator Declaration Clause A-2
Executable Clause A-4
Statement Clause A-5
Assignment Clause A-5
Host Expression A-6
Supported SQL Statements A-8
B. SQLJ Runtime Package
sqlj.runtime.ConnectionContext Interface B-2
ConnectionContext Variable Details B-2
ConnectionContext Method Details B-3
sqlj.runtime.ForUpdate Interface B-5
sqlj.runtime.NamedIterator Interface B-5
sqlj.runtime.PositionedIterator Interface B-6
PositionedIterator Method Details B-6
sqlj.runtime.ResultSetIterator Interface B-7
ResultSetIterator Method Details B-7
sqlj.runtime.AsciiStream Class B-10
AsciiStream Constructor Details B-11
B. SQLJ Runtime Package (continued)
sqlj.runtime.ExecutionContext Class B-12
ExecutionContext Constructor Details B-13
ExecutionContext Method Details B-13
sqlj.runtime.CharacterStream Class B-16
CharacterStream Constructor Details B-16
sqlj.runtime.ref.DefaultContext Class B-18
DefaultContext Method Details B-18
C. Sample Programs
Using SQLJ Source Files C-1
Installing the sampleSQLJ.jar File C-1
Installing the SQL/MX Sample Database C-1
SampleDDL.sqlj—Creating Tables From an SQLJ Program C-2
SQLJ Source File C-2
Translating the Program C-8
Running the Program C-8
Results of Running the Program C-8
SampleDML.sqlj—Inserting, Deleting, Updating, and Selecting Data C-9
SQLJ Source File C-9
Translating the Program C-11
Running the Program C-12
Results of Running the Program C-12
MultiThread1.sqlj—Threads With Explicit Execution Contexts C-13
SQLJ Source File C-13
Translating the Program C-14
Running the Program C-14
Results of Running the Program C-15
MultiThread2.sqlj—Threads With Explicit Connection Contexts C-16
SQLJ Source File C-16
Translating the Program C-18
Running the Program C-18
Results of Running the Program C-18
StreamParcels.sqlj—Stream Access Mode C-19
SQLJ Source File C-19
Translating the Program C-20
Running the Program C-20
Results of Running the Program C-21
C. Sample Programs (continued)
StreamTimeout.sqlj—Stream Timeout Setting C-22
SQLJ Source File C-22
Translating the Program C-24
Running the Program C-24
Results of Running the Program C-24
EmbeddedDelete.sqlj—Embedded DELETE C-25
SQLJ Source File C-25
Translating the Program C-26
Running the Program C-26
Results of Running the Program C-27
EmbeddedUpdate.sqlj—Embedded UPDATE C-28
SQLJ Source File C-28
Translating the Program C-29
Running the Program C-29
Results of Running the Program C-30
SetOnRollback.sqlj—Setting Column Values on Rollback C-31
SQLJ Source File C-31
Translating the Program C-32
Running the Program C-33
Results of Running the Program C-33
D. SQLJ Error Messages
SQLJ Processing Errors D-1
Command-Line Options Processing (0000-000100—0002-007100) D-1
SQLJ Syntax Checking (0100-000200—0100-002800) D-6
Semantic Analysis (0201-000100—0201-022306) D-11
Profile-to-Class Conversion (0300-000100—0300-001500) D-61
Java Syntax Checking (0500-000400—0500-005000) D-62
Customization (0600-001100—0600-004200) D-72
Java Code Generation (0700-000100—0700-001600) D-76
Data Customization (0900-000100—0900-003000) D-81
SQLJ Customizer (1000-000200—1000-000700) D-88
SQLJ Run-Time Errors D-90
SQLSTATE Values D-90
SQLJ Run-Time Messages D-90.

 Read more about SQL/MX Programming Manual for Java

Resource: http://docs.hp.com/en/523726-003/523726-003.pdf
Posted By : Mariana
On date : 07.17.08

Most used JAVA Tutorials

JAVA Tutorials ( Ebooks , PDF's )
Java Code Conventions Java and C++ A critical comparison Generics in the Java Programming Language Writing Robust Java Code
Brewing Java: A Tutorial
Part 1 is a brief introduction to what Java is, why it's cool and what you need to use it. Part 2 is a tutorial introduction to Java that just covers what you need to know to start programming command line applications in Java. This is an introduction to the basic syntax of the language. It skims over many details and completely omits little used features like bit-shift operators. This section is fairly complete. Part 3 covers the basics of writing applets in Java. Part 4 introduces you to objects and classes.
JAVA Interview Questions & Answers
What is a transient variable, Why do threads block on I/O, How are Observer and Observable used, What is synchronization and why is it important, Can a lock be acquired on a class, What is the Collections API,What is the List interface, What is the Vector class, What is an Iterator interface, What is the difference between yielding and sleeping, What are wrapper classes, What is the difference between preemptive scheduling and time slicing, What is clipping, What class is the top of the AWT event hierarchy, What is the purpose of the wait(), notify(), and notifyAll() methods ... etc... etc...
Struts interview Questions and answers | FAQs
Interview questions and answers of Struts
The java.util.concurrent package Collections
The java.util.concurrent package includes a number of additions to the Java Collections Framework.
JAVA PDF Tutorials, Code Conventions, Writing Robust Java Code
Java Code Conventions,Java and C++ A critical comparison,Generics in the Java Programming Language,Writing Robust Java Code
JFreeChart Introduction
JFreeChart is a free 100% Java chart library that makes it easy for developers to display professional quality charts in their applications. JFreeChart's extensive feature set includes:
SCJP Sun Certified Programmer for Java 6 Exam 310-065 - Tutorial book
With hundreds of practice questions and hands-on exercises, SCJP Sun Certified Programmer for Java 6 Study Guide covers what you need to know--and shows you how to prepare--for this challenging exam.
NetBeans, Java, and JFreeChart | PDF study material
This set of “papers” consists of an introduction to JFreeChart and NetBeans as an IDE for Java programming. I attempt herein to ease the learning burden, a little, compared to the misery that I had to suffer through. We are using JDK 1.5.0_03, NetBeans 4.1 (for future work, we've gone over to 5.0), and jfreechart-1.0.0-rc1. I hope its not necessary to mention that all of these programs are free, in the public domain, and can be downloaded and installed on modern PCs.
JSF and Struts Classic Reference Manual | Pdf study material
The following chapters describe how to deal with classic/old style of JSF and Struts development. We recommend users to use JBoss Seam [http://www.redhat.com/developers/jbds/Getting_Started/GetStartSeamGen.html] to simplify development, but until then you can read about classical JSF and Struts usage here.We are going to show you how to create a simple JSF application using the JBoss Developer Studio plug-in for Eclipse.
Effective Java (2nd Edition) - Java Book
Are you looking for a deeper understanding of the Java™ programming language so that you can write code that is clearer, more correct, more robust, and more reusable? Look no further! Effective Java™, Second Edition, brings together seventy-eight indispensable programmer’s rules of thumb: working, best-practice solutions for the programming challenges you encounter every day.
Java Interface User Guide (JAVA PDF)
This Java tutorial covers the details of Java Interface User Guide.An Introduction to the Java Interface The Datalogics Java Interface provides a Java-language wrapper to the Adobe PDF Library to facilitate the rapid creation of PDF documents via Java calls. The Adobe PDF Library is C-based, not Java-sourced, but as it is usable by any application type which supports calls to a C-based library, the Datalogics Java Interface has been created.
Java Technology - What java does? - How java works
Java technology is both a programming language and a platform. In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes - the machine language of the Java Virtual Machine1 (Java VM). The java launcher tool then runs your application with an instance of the Java Virtual Machine.
Executor Interfaces in JAVA
The java.util.concurrent package defines three executor interfaces: Executor, a simple interface that supports launching new tasks. ExecutorService, a subinterface of Executor, which adds features that help manage the lifecycle, both of the individual tasks and of the executor itself.
This Java tutorial covers the details of BASIC CONCEPTS LESSON-1 JAVA OVERVIEW (JAVA PDF).Before you can start writing Java programs, you need acquire and set up some kind of Java programming software.

Latest added JAVA Tutorials

TDD and Acceptance TDD for Java Developers tutorial book
Learn hands-on to test drive Java code How to avoid common TDD adoption pitfalls Acceptance test driven development and the Fit framework How to test Java EE components-Servlets, JSPs, and Spring Controllers
Java Concurrency in Practice - Book
Threads are a fundamental part of the Java platform. As multicore processors become the norm, using concurrency effectively becomes essential for building high-performance applications. Java SE 5 and 6 are a huge step forward for the development of concurrent applications, with improvements to the Java Virtual Machine to support high-performance, highly scalable concurrent classes and a rich set of new concurrency building blocks. In Java Concurrency in Practice, the creators of these new facilities explain not only how they work and how to use them, but also the motivation and design patterns behind them.
SCJP Sun Certified Programmer for Java 6 Exam 310-065 - Tutorial book
With hundreds of practice questions and hands-on exercises, SCJP Sun Certified Programmer for Java 6 Study Guide covers what you need to know--and shows you how to prepare--for this challenging exam.
Head First Design Patterns - Java tutorial Book
At any given moment, somewhere in the world someone struggles with the same software design problems you have. You know you don't want to reinvent the wheel (or worse, a flat tire), so you look to Design Patterns--the lessons learned by those who've faced the same problems. With Design Patterns, you get to take advantage of the best practices and experience of others, so that you can spend your time on... something else. Something more challenging. Something more complex. Something more fun.
Effective Java (2nd Edition) - Java Book
Are you looking for a deeper understanding of the Java™ programming language so that you can write code that is clearer, more correct, more robust, and more reusable? Look no further! Effective Java™, Second Edition, brings together seventy-eight indispensable programmer’s rules of thumb: working, best-practice solutions for the programming challenges you encounter every day.
Head First Java, 2nd Edition - Java Book
It has taken four years, but with Head First Java the introductory Java book category has finally come of age. This is an excellent book, far more capable than any of the scores of Java-for-novices books that have come before it. Kathy Sierra and Bert Bates deserve rich kudos--and big sales--for developing this book's new way of teaching the Java programming language, because any reader with even a little bit of discipline will come away with true understanding of how the language works. Perhaps best of all, this is no protracted "Hello, World" introductory guide. Readers get substantial exposure to object-oriented design and implementation, serialization, neatwork programming, threads, and Remote Method Invocation (RMI).
Learn how to load, validate and submit forms in Ext JS
This tutorial focuses on the topic of 'Processing Forms'. The journey will include client-side and server-side ?eld validation, form loading, submission, ?eld customization, and layout techniques that will make it a breeze to build great-looking and friendly forms.
Useful Apache Maven Plugins
This tutorial discusses some of the Maven plugins, both from Apache Maven and Codehaus Mojo project which are of great help to Maven builds.
while - Java Term
Details about the Java term while
volatile - Java Term
Details about the Java term volatile