Catálogo de publicaciones - libros

Compartir en
redes sociales


Expert Oracle JDBC Programming

R. M. Menon

Resumen/Descripción – provisto por la editorial

No disponible.

Palabras clave – provistas por la editorial

Software Engineering/Programming and Operating Systems

Disponibilidad
Institución detectada Año de publicación Navegá Descargá Solicitá
No detectada 2005 SpringerLink

Información

Tipo de recurso:

libros

ISBN impreso

978-1-59059-407-0

ISBN electrónico

978-1-4302-0029-1

Editor responsable

Springer Nature

País de edición

Reino Unido

Fecha de publicación

Información sobre derechos de publicación

© Apress 2005

Tabla de contenidos

Performance Toolkit

R. M. Menon

This chapter covered some of the tools that we will use throughout this book, mainly in our performance benchmark programs. Many of these tools involve concepts that are explained in the references provided where the tool was mentioned. Some of these tools are written using JDBC concepts, which are explained elsewhere in this book. I recommend revisiting the code for these utilities once you’ve grasped the underlying concepts from the later chapters.

In the next chapter, we’ll look at some of the fundamental concepts related to Oracle that every Oracle application programmer (including JDBC programmers) should be familiar with.

Pp. 1-32

Oracle Fundamentals

R. M. Menon

In this chapter, you looked at some examples that demonstrate why it is critical for an Oracle application developer to know about Oracle’s features and the Oracle architecture. You learned some important Oracle concepts, such as multiversion read consistency, undo, redo, and so on, that should whet your appetite and motivate you to learn more about Oracle. You also learned why mastering SQL and PL/SQL is crucial in achieving your goal of being an effective JDBC programmer. You may need to put in some additional effort to learn more about the concepts touched on in this chapter from the many references I gave throughout. In the next chapter, you will consider the JDBC API and write your first JDBC program.

Pp. 33-77

Introduction to JDBC

R. M. Menon

In this chapter, you were introduced to the JDBC API. You looked at different types of JDBC drivers and how to choose the one appropriate for your software development requirements. You discovered how to set up an environment for using the JDBC thin and OCI drivers, and you examined the various options of establishing a connection to the Oracle database and why you should consider using DataSource instead of Driver Manager to establish such a connection. Finally, you wrote and analyzed your first JDBC program, which executes a query against Oracle database and prints out the query results. In the next chapter, you will look at the JDBC API associated with database transactions.

Pp. 79-113

Transactions

R. M. Menon

In this chapter, we briefly covered transactions, the different transaction isolation levels available, and the transaction isolation levels supported by Oracle. We discussed why we should commit a transaction based on business need, rather than on the amount of resources the transaction consumes. As you learned, breaking your transaction into smaller chunks with intermittent commits can lead to compromised data integrity, increased code complexity, and an overall slower system. You learned the importance of always turning off autocommit and explicitly executing a commit or rollback as required to end your transaction. You also examined transaction savepoints as applicable to JDBC applications, and you saw a use case illustrating savepoints.

In the next two chapters, we will look at statements that enable you to do all the work within your transaction.

Pp. 115-138

Statement and PreparedStatement

R. M. Menon

In this chapter, you learned how to query and modify data using the JDBC classes Statement, PreparedStatement, and OraclePreparedStatement. You also learned the reasons you should not use the Statement class in production code, as it does not support using bind variables. By using bind variables in your program, you not only make your application more performant and scaleable, but you also make it more secure by preventing SQL injection attacks.

You discovered how to boost application performance tremendously by using update batching, which in Oracle is available only when you use prepared statements. You saw a comparison of standard and Oracle update batching in terms of elapsed times and latch consumption, and you observed that Oracle update batching outperforms standard update batching in terms of elapsed time (in terms of latches, the difference between the two is negligible). You also saw how batching can dramatically reduce the latch consumption, thus improving scalability. You looked at how mixing interdependent batch statements in your application can sometimes lead to unexpected results.

A major take-away message from this chapter is that, if you are embedding SQL statements in your JDBC code, you should use a PreparedStatement object and use bind variables wherever appropriate. However, a strong case can also be made for wrapping your DML statements in PL/SQL packaged procedures and invoking them from JDBC using CallableStatement objects. This is what we will examine in the next chapter.

Pp. 139-185

CallableStatement

R. M. Menon

In this chapter, you looked at the CallableStatement and OracleCallableStatement interfaces and how you can use them to invoke stored SQL procedures using both the SQL92 syntax and the Oracle syntax. In addition, I made a strong case for almost exclusively using CallableStatement in programs to invoke logic that resides in PL/SQL packaged subprograms.

Pp. 187-207

Result Sets Explored

R. M. Menon

In this chapter, we briefly covered transactions, the different transaction isolation levels available, and the transaction isolation levels supported by Oracle. We discussed why we should commit a transaction based on business need, rather than on the amount of resources the transaction consumes. As you learned, breaking your transaction into smaller chunks with intermittent commits can lead to compromised data integrity, increased code complexity, and an overall slower system. You learned the importance of always turning off autocommit and explicitly executing a commit or rollback as required to end your transaction. You also examined transaction savepoints as applicable to JDBC applications, and you saw a use case illustrating savepoints.

In the next two chapters, we will look at statements that enable you to do all the work within your transaction.

Pp. 209-275

Oracle Objects: An Objective Analysis

R. M. Menon

In this chapter, you learned about different ways in which objects are useful in Oracle. In particular, you learned about three different ways in which objects are useful:

You discovered that it is best to use objects as a programming construct to enhance the power of your PL/SQL code. Storing data in object tables that contain varrays or nested table columns can lead to complex code that does not perform well, as you learned from the performance study done at the end of the chapter. In particular, you discovered that DMLs on relational tables perform much better in general when compared to DMLs carried out on object views and tables containing nested tables. In the next chapter, we will look at how to access objects from JDBC.

Pp. 277-321

Using Weakly Typed Struct Objects

R. M. Menon

This chapter defined weakly typed and strongly typed objects. You learned how to use the Struct interface to select objects as a collection of attributes. You also learned how to insert and update objects stored in tables using oracle.sql.STRUCT class methods. The steps involved in these operations tend to be more complicated than the straightforward relational alternative. You saw that this is particularly true when performing updates. In the next chapter, you will learn how to access and manipulate objects in tables using strongly typed objects.

Pp. 323-344

Using Strongly Typed Interfaces with JPublisher

R. M. Menon

In this chapter, you learned what strongly typed interfaces are. You examined the JDBC standard interface, SQLData, and the Oracle extension interfaces, ORAData and ORADataFactory. You learned about the various options provided by JPublisher, a utility that generates custom classes mapping SQL objects to Java for you. You also learned, through examples, how to use JPublisher to generate custom classes that implement either SQLData or ORAData interfaces that allow you to retrieve and manipulate objects stored in the database. In the next chapter, we will examine how to use collections and references in a JDBC program.

Pp. 345-385