Thursday, May 29, 2008

Building Oracle XML Applications

This rich and detailed research into many Oracle tools that support the development shows XML Java and PL / SQL developers how to combine the power of XML and XSLT with speed, functionality and reliability of the Oracle database.

The nearly 800 pages of text fun, useful and time-saving tips, and examples can be utilized immediately to build custom applications XML. Includes a CD-ROM with 3.1 JDeveloper, an integrated development environment for Java developers.

We used XSLT stylesheets in previous chapters to transform XML database in HTML pages, XML datagrams a vocabulary, SQL scripts, e-mails, and so forth. If you're a developer trying to exploit your database up to the Web, you will see that XSLT is the swiss army knife that you want permanently attached to your belt. In a world where the exchange of structured information is essential to your success, and where the ability to evolve quickly and repurpose information is paramount, Oracle XML developers who understand how to exploit XSLT are well ahead of the pack.

W3C XSLT 1.0 is the standard language to describe the transformations between XML documents. It is closely aligned with the companion XPath 1.0 standard and works in concert with it. As we see in this chapter, XPath can say what to transform, and XSLT provides additional language describing how to carry out the transformation. A XSLT stylesheet describes a set of rules to transform an XML document source XML result. A XSLT processor is the software that performs processing on the basis of these rules.

In simple examples in previous chapters, we saw three ways to use the Oracle database XSLT processor. We used the oraxsl command-line utility, the XSLT processor programming API, and instruction involving a stylesheet with a XSQL page. In this chapter we begin to explore the power of language XSLT to understand how best to use it in our applications.

Download Building Oracle XML Applications

JDBC Pocket Reference

JDBC Pocket reference offer quick look-ups for all methods of the standard JDBC classes. These comments concise common procedures for JDBC tasks such as connecting to a database, execute stored procedures, DDL execution and so forth.

You'll find documentation for the connection string formats for most common databases, including Oracle, SQL Server and PostgreSQL. You'll even find information on working with large objects, and the use of SQL99 data defined by the user to work with the object relational data. The search for such equipment by major tutorials is frustrating and a waste of time, but this pocket-sized book is easy to be done and find the information you need at a glance.

Defined by the user data types (UDTS) bring the world of objectorientation to relational databases. Use UDTS, you can create an object relational database, or objectbase, in which an object model can be directly implemented in the persistence layer. To store and retrieve UDTS, you can manipulate the structures and SQL tables (which I will not be shown here), or you can define Java classes that are mapped to the UDTS SQL, then you use to materialize ' UDTS Java program.

The Java classes that will be used to materialize a UDT need to implement the SQLData interface. Most databases that support UDTS also provide a tool to generate Java classes that implement SQLData. Implementation of SQLData interface consists of three coding methods. The first, getSQLTypeName () must return the full name of the UDT, as it exists in the database. The second, readSQL (), read your attributes class SQLInput a stream in the order in which they exist in the UDT. The third, writeSQL (), writes the values of your class attributes on the SQLOutput flows in order of output in the UDT.

Download JDBC Pocket Reference

Mastering Oracle SQL, Second Edition

Updated to cover Oracle 10g, this edition of the highly regarded Mastering Oracle SQL has a stronger focus on practical, expert best-practices and on Oracle-specific SQL technique than any other book on the market. For those who want to harness the untapped (and often overlooked) power of Oracle SQL, this essential guide for putting Oracle SQL to work will prove invaluable.

There are situations when we need to combine the results from two or more SELECT statements. SQL enables us to handle these requirements by using set operations. The result of each SELECT statement can be treated as a set, and SQL set operations can be applied on those sets to arrive at a final result. Oracle SQL supports the following four set operations:

UNION ALL
UNION
MINUS
INTERSECT

SQL statements containing these set operators are referred to as compound queries, and each SELECT statement in a compound query is referred to as a component query. Two SELECTs can be combined into a compound query by a set operation only if they satisfy the following two conditions:

The result sets of both the queries must have the same number of columns.
The data type of each column in the second result set must match the data type of its corresponding column in the first result set.
These conditions are also referred to as union compatibility conditions. The term union compatibility is used even though these conditions apply to other set operations as well. Set operations are often called vertical joins, because the result combines data from two or more SELECTS based on columns instead of rows. The generic syntax of a query involving a set operation is:

component_query {UNION UNION ALL MINUS INTERSECT} component_query

The keywords UNION, UNION ALL, MINUS, and INTERSECT are set operators. You can have more than two component queries in a composite query; you will always use one less set operator than the number of component queries.

There is an exception to the second union compatibility condition. Two data types do not need to be the same if they are in the same data type group. By data type group, we mean the general categories such as numbers, strings, and datetimes. For example, it is ok to have a column in the first component query of data type CHAR, that corresponds to a VARCHAR2 column in the second component query (or vice versa). Oracle performs implicit type conversion in such a case.

However, Oracle will not perform implicit type conversion if corresponding columns in the component queries belong to different data type groups. For example, if a column in the first component query is of data type DATE, and the corresponding column in the second component query is of data type CHAR, Oracle will not perform implicit conversion, and you will get an error as a result of violation of data type compatibility. This is illustrated in the following example:

SELECT TO_DATE('12-OCT-03') FROM DUAL UNION SELECT '13-OCT-03' FROM DUAL; SELECT TO_DATE('12-OCT-03') FROM DUAL * ERROR at line 1: ORA-01790: expression must have same datatype as corresponding expression

The following sections discuss syntax, examples, rules, and restrictions for the four set operations.

Downlaod Mastering Oracle SQL, Second Edition

An Introduction to SQL Injection Attacks for Oracle Developers

Most application developers underestimate the risk of SQL injection attacks against Web applications using Oracle as the back-end database. Our audits of custom web applications show many application developers are not fully understand the risk of attacks by SQL injection and simple techniques used to prevent such attacks.

This document is intended for application developers, database administrators, and application of listeners to highlight the risk of attacks by SQL injection and demonstrate why web applications are vulnerable May. It is not intended to be a tutorial on the execution of SQL attacks and not give instructions on carrying out these attacks.

SQL Injection is an attack base is used to obtain unauthorized access to a database or to obtain information directly from the database. The principles underlying a SQL injection are simple and these types of attacks are easy to perform and master.

We believe that Web applications using Oracle as a back-end database are more vulnerable to attacks by SQL injection that most believe that application developers. Our application audits have found numerous web applications vulnerable to SQL injection even if well-established coding standards have been established during the development of many of these applications. Function-based SQL injection attacks are very worrying, because these attacks do not require knowledge of the application and can be easily automated.

Oracle has generally faired, and attacks against SQL injection because there is no support multiple SQL (SQL Server and PostgreSQL), no statement EXECUTION (SQL Server), and no function INTO OUTFILE (MySQL). Also, using bind variables in Oracle environments for performance reasons provides the most effective protection against attacks by Oracle SQL injection May provide stronger and more inherent protections against attacks by SQL injection than other bases data, however, Oracle-based applications without defenses against these types of attacks may still be vulnerable.

Download An Introduction to SQL Injection Attacks for Oracle Developers

Introduction to Oracle 10g R1 on SUSE LINUX Professional 9.3

This paper is designed to help you get started with Oracle 10g on SUSE LINUX 9.3. This will help you to work on latest SUSE OS and latest Oracle Database 10g from Oracle.

Oracle 10g is supported and certified only on SUSE LINUX Enterprise Server (SLES) but occasionally for development and testing purposes you will prefer to have it up and running on your desktop for quick access. Instruction provided here will also work on SUSE LINUX 9.2.

Install SUSE LINUX Operating System
Follow the Installation instructions provided in the SUSE LINUX 9.3 installation manual. We will focus on Oracle related component and make sure you meet Oracle software space requirement. SUSE LINUX 9.3 with default packages along with “C/C++ Compiler and Tools” is sufficient for Oracle 10g R1 (10.1.0.3) install. Here is snap-shot from my system.
Check whether C/C++ compiler is installed. “gcc –version” will show “gcc (GCC) 3.3.3 (SUSE LINUX)”. If gcc is not installed, then use YaST setup tool to install “C/C++ Compiler and Tools”.

Oracle Install prerequisites
Refer to Oracle installation document for complete list of prerequisites. Novell/SUSE provides orarun packages to automate most of the Oracle preinstall task. orarun package is not included in SUSE LINUX 9.3 as this is for SUSE LINUX Enterprise Server.

Download Introduction to Oracle 10g R1 on SUSE LINUX Professional 9.3

Oracle/SQL Tutorial

The Oracle / SQL tutorial provides a detailed introduction to the language of SQL and Oracle Relational Database Management System. For more information about Oracle and SQL can be found on the website www.db.cs.ucdavis.edu / dbs.

Many tasks of data management, however, occur in engineering applications and sophisticated these tasks are too complex to be dealt with by such an interactive tool. Typically, the data are produced and handled calculation in the complex application programs that are written in a third-generation language (3GL) and which, therefore, need an interface with the database system. In addition, a majority of existing data-intensive engineering applications are written previously using a programming language imperative and now we want to use the functionality of a database system, which requires an easy to use l 'programming interface to the database system. Such an interface is provided in the form Embedded SQL, SQL integration in various programming languages such as C, C + +, Cobol, Fortran etc. Embedded SQL provides programmers implementing an appropriate way to combine the power of calculating a programming language with data manipulation and management capabilities of the declarative language SQL.

Since all these interfaces have comparable features in the following situations, we describe the integration of SQL in the programming language C. For this, we base our discussion on the Oracle interface to C, called Pro * C. The emphasis in this section is placed on the description of the interface, not on the introduction of the programming language C.

Download Oracle/SQL Tutorial

PL/SQL User’s Guide and Reference 10g

The PL/SQL language is tightly integrated with SQL. You do not have to translate between SQL and PL/SQL datatypes: a NUMBER or VARCHAR2 column in the database is stored in a NUMBER or VARCHAR2 variable in PL/SQL.

This integration saves you both learning time and processing time. Special PL/SQL language features let you work with table columns and rows without specifying the datatypes, saving on maintenance work when the table definitions change.

Download PL/SQL User’s Guide and Reference 10g