With the growth of Java and the rise of database-powered Web applications, the need to use Java with SQL is clear. Until now, authoritative coverage of the techniques available to meet these challenges and reap their benefits-both programming and career benefits-didn't exist. Understanding SQL and Java Together examines all the standards for combining SQL and Java. It shows you exactly how to use their features to write efficient and effective code supporting Java access to SQL data in a variety of ways. You'll gain a thorough understanding of the relationship between SQL and Java, which will allow you to write static and dynamic SQL programs in Java, merge Java code with SQL databases and SQL code, and use other data management techniques wherever appropriate.
Database vendors like Oracle and Sybase have quickly signed on with Java support. The result has been a growing list of database standards (like SQLJ) that let DBMS products interoperate with Java. Written for the competent programmer,
Understanding SQL and Java Together surveys all of the today's standards for making database development easier with Java.
Many books on Java cover JDBC in detail, but this title goes much further by surveying a handful of other database standards from a variety of vendors including Oracle and Sybase. (Don't worry: there's full coverage of JDBC, both version 1.0 and 2.0.) The real focus of this book is on SQLJ, which is really three standards in one. SQLJ Part 0 is the easiest to understand as it supports embedded SQL calls within Java code. Next comes SQLJ Part 1 where a database product (like Oracle) can use Java to define stored procedures. Here, the authors take care to show off how to deploy JAR files into a database. (Their sample movie database--used throughout this book--is both comprehensible and a little more entertaining than most sample database schemas.)
Next, the authors look at SQL user-defined types (UDTs) and then SQLJ Part 2, which allows Java code to make use of these UDTs directly, as well as store Java objects in a database. The last stop on the tour is a "true" object/relational mapping, Sun's Java Blend standard, which allows Java objects to be saved and restored from a database transparently. The book also reviews several of today's Java development tools (including Oracle's JDeveloper, which is included on the accompanying CD in a starter version).
Of course, readers will have to wait and see if the more object-oriented approach will displace the older relational model. (The authors put in their proverbial two pence on the future of Java database standards.) In the meantime, programmers are lucky to have so many options when it comes to working with databases in Java. But until this book, information on standards beyond JDBC was in scarce supply. Understanding SQL and Java Together fills a valuable need by cataloging and describing all of today's advanced Java database standards, a valuable combination that readers won't likely find anywhere else. --Richard Dragan, amazon.com
Topics covered: Overview of Java used with databases; refresher course on basic Java, SQL tutorial, Java Database Connectivity (JDBC) v. 1.0/v. 2.0 APIs (connecting to JDBC data sources, using result sets), SQLJ Part 0 and embedded SQL, the SQLJ Part 0 translator and runtime classes, SQLJ Part 1: Java stored procedures and deployment tips for JAR files; tutorial for SQL User Defined Types (UDTs), the SQL:1999 standard, structured types, typed tables and table hierarchies; SQL Part 2: accessing UDTs from within Java; Java Blend and ODMG Java database mappings, persisting Java objects, database schemas and Java objects, review of GUI-based Java tools (PowerJ, JDeveloper and Visual J++), future directions for Java database standards, and syntax reference for SQLJ Part 0, 1 and 2.