I have a book I can recommend to you. It's called Oracle 8 Programming: A Primer
by Rajshekhar Sunderraman, published by Addison Wesley, 2000, ISBN 0-201-61258-5. It was actually one of my text books for a database class I took, but I keep it on my desk at work and still refer to it. It may have been updated from the one I have.
It's small, only 334 pages, but chock full of useful material that is understandable by an Oracle and database novice who already has some programming background. There isn't a lot of handholding, but the information is presented in a clear, easy to understand manner. After going through this book you will have enough mixture of theoretical and practical knowledge to make yourself dangerous.
The book begins with a sixteen page chapter that goes into more theoretical and necessary background types of information. Here the author discusses the realtional data model, schemes, integrity constraints, tables, and he goes over the sample database the book uses for its examples. There is also a really nice section in this chapter introducing relational algebra, dividing the discussion between set-theoretic operations (union, difference, intersection, cartesian product) and relation-theoretic operations (rename, select, project, natural join, division). Don't let the term algebra
scare you off. The material is explained in simple terms and will give you insight into how to make the most concise queries.
The next chapter discusses Oracle SQL. Here you will learn how to use SQL*Plus, manipulate tables, modify the database (insert, update, delete), perform queries, work with views and sequences, work with the Oracle data dictionaries, and how to create Oracle objects (TYPEs). This is pretty much the meat of the book and the part you need to digest to work with Oracle on a daily basis.
Now that you understand what a relational database is, and how to do routine operations in Oracle, it's time to tackle PL/SQL. Once again this chapter will give you all the information you need to be dangerous. You will learn how a PL/SQL program is structured and how to write them, including writing stored procedures, functions, and packages. You will also learn about triggers, cursors, records, Oracle's built-in packages, error handling, and working with Oracle objects in PL/SQL. The information in this chapter will help you get the most out of your Java programs by moving much of your SQL out of Java and into an Oracle stored procedure where it most likely belongs.
What use would a book on programming Java be to us without a section on JDBC
? This information isn't updated for JDBC 2.0 in the version I have, but that's okay because you are still presented with everything you need in order to get started with JDBC. Drivers, connections, statements (including prepared and callable), result sets, metadata, and REFCURSORS are all discussed. Also included is a sample JDBC application to see it in action. This helped me to develope my first ever Java program, which was an academic exercise modeling an airline database system, without really knowing any Java prior to this (Core Java2 Vol I also helped). I found myself refering back to this airline database program (and this text) some time later when I had to develope my first professional JDBC application, which means for me at least, this book paid for itself.
The rest of the book contains some information on embedded SQL in C and C++, SQLJ (embedded SQL in Java), and a chapter that gives some project suggestions for trying out your newly acquired knowledge.
There is nothing flashy about this book, but particularly for someone without much Oracle and/or JDBC experience, it is extremely useful. I have loaned it out to coworkers and they have all shared this opinion. Do yourself a favor and check it out.
Two other books I have which are nice are Oracle PL/SQL Programming
(O'Reilly), and Oracle 8i Application Programming with Java, PL/SQL, and XML
(Wrox). If you need to get heavy into PL/SQL, you can't go wrong with the O'Reilly book. I got the Wrox book mainly for its section on Java Stored Procedures, something there doesn't seem to be a lot of documentation on. It also has a pretty good section on Data Sources. I have only had an opportunity on a couple of occasions to actually use either of these books, but they are nice to have around as references.