Mehr lesen
Acknowledgments. PART ONE. 1. Introduction. What the JDBC 3.0 API Includes. Conventions Used in This Book. Fonts to Indicate Function. Icons to Indicate New Material. Special Page Designations in the Index. SQLException Is Implied in Method Explanations. Some Method Explanations Are Combined. Contents of the Book. Part One. Part Two. Suggested Order for Reading Chapters. Where to Find Information by Topic. Resources on the Web. What Is the JDBC API? What Does the JDBC API Do? A Base for Other APIs. The JDBC API versus ODBC. Two-tier and Three-tier Models. SQL Conformance. Products Based on JDBC Technology. JDBC Product Framework. JDBC Driver Types. Obtaining JDBC Drivers. Java-relational DBMSs. Other Products. The JDBC API and the Java Platforms. The JDBC API and the J2SE Platform. The JDBC API and the J2EE Platform. The JDBC API and the J2ME Platform. Java Overview. Java Is Portable. Java Is Object-oriented. Java Makes It Easy to Write Correct Code. Java Includes a Library of Classes and Interfaces. Java Is Extensible. Java Is Secure. Java Performs Well. Java Scales Well. Java Is Multithreaded. Relational Database Overview. Integrity Rules. SELECT Statements. WHERE Clauses. Joins. Common SQL Commands. Result Sets and Cursors. Transactions. Stored Procedures. Metadata. 2. Basic Tutorial. Getting Started. Setting Up a Database. Establishing a Connection. Loading Drivers. Making the Connection. Setting Up Tables. Creating a Table. Creating JDBC Statements. Executing Statements. Entering Data into a Table. Getting Data from a Table. Retrieving Values from Result Sets. Using the Method next. Retrieving Column Values. Using the Method getString. Updating Tables. Milestone: The Basics of JDBC. Using Prepared Statements. When to Use a PreparedStatement Object. Creating a PreparedStatement Object. Supplying Values for PreparedStatement Parameters. Using a Loop to Set Values. Return Values for the Method executeUpdate. Using Joins. Using Transactions. Disabling Auto-commit Mode. Committing a Transaction. Using Transactions to Preserve Data Integrity. When to Roll Back a Transaction. Stored Procedures. SQL Statements for Creating a Stored Procedure. Calling a Stored Procedure Using the JDBC API. Creating Complete JDBC Applications. Putting Code in a Class Definition. Importing Classes to Make Them Visible. Using the main Method. Using try and catch Blocks. Retrieving Exceptions. Retrieving Warnings. Running the Sample Applications. Sample Code. Sample Code 1 and 2. Sample Code 3 and 4. Sample Code 5. Sample Code 6. Creating an Applet from an Application. Writing Applet Code. Running an Applet. Sample Code 7 and 8. ...