JDBC database access with Java
A tutorial and annotated reference
Graham Hamilton, Rick Cattell, Maydene Fisher - Collection The Java series
Résumé
From the creators of the JDBC API at JavaSoft, here is the definitive guide to this vital new technology. Appropriate for Java programmers of all skill levels, this book provides explanations of JDBC and Java fundamentals, a step-by-step tutorial to bring you up to speed, and an extensively annotated reference to all JDBC classes and interfaces. Overviews of Java and the JDBC API explain how JDBC fits into the world of SQL and relational databases. The tutorial walks you through JDBC, demonstrating how to execute common tasks with numerous examples. For those interested in writing applications that access various database systems, the JDBC Metadata API is also introduced. The alphabetically arranged reference section is comprehensive and detailed, containing class and interface definitions along with a wealth of in-depth information on methods and fields. Also included is important information on mapping Java and SQL types, a look at the rationale behind JDBC's design, and a glimpse into JDBC's future.
Audience: Anyone interested in pursuing the many development opportunities made possible by JDBC will find this book an indispensable resource.
Table of contents :
Acknowledgments ..... vii
Part One
- 1 Introduction ..... 3
- 1.1 Contents of the Book ..... 3
1.2 What Is JDBC ..... 5
1.3 Java Overview ..... 15
1.4 Relational Database Overview ..... 24
- 1.1 Contents of the Book ..... 3
- 2 Basic Tutorial ..... 33
- 2.1 Getting Started ..... 33
2.2 Setting Up a Database ..... 34
2.3 Establishing a Connection ..... 35
2.4 Setting Up Tables ..... 37
2.5 Getting Data from a Table ..... 42
2.6 Retrieving Values from Result Sets ..... 44
2.7 Updating Tables ..... 47
2.8 Milestone: The Basics of JDBC ..... 49
2.9 Using Prepared Statements ..... 49
2.10 Using Joins ..... 53
2.11 Using Transactions ..... 55
2.12 Stored Procedures ..... 59
2.13 Creating Complete JDBC Applications ..... 61
2.14 Running the Sample Applications ..... 67
2.15 Sample Code ..... 68
2.16 Creating an Applet from an Application ..... 81
- 2.1 Getting Started ..... 33
- 3 Metadata Tutorial ..... 89
- 3.1 Getting Information about a Result Set .....
89
3.2 Getting Information about a Database or Database System ..... 101
3.3 A Generic Application ..... 116
- 3.1 Getting Information about a Result Set .....
89
- 4 CallableStatement ..... 129
- 4.1 CallableStatement Overview ..... 129
4.2 CallableStatement Definition ..... 134
4.3 CallableStatement Methods ..... 134
- 5.1 Connection Overview ..... 143
5.2 Connection Interface Definition ..... 150
5.3 Connection Methods ..... 151
5.4 Connection Fields ..... 161
- 6.1 DatabaseMetaData Overview ..... 163
6.2 DatabaseMetaData Interface Definition ..... 166
6.3 DatabaseMetaData Methods ..... 173
6.4 DatabaseMetaData Fields ..... 236
- 7.1 DataTruncation Overview ..... 247
7.2 DataTruncation Class Definition ..... 249
7.3 DataTruncation Constructor ..... 249
7.4 DataTruncation Methods ..... 250
- 8.1 Date Overview ..... 253
8.2 Date Class Definition ..... 254
8.3 Date Constructors ..... 254
8.4 Date Methods ..... 255
- 9.1 Driver Overview ..... 257
9.2 Driver Interface Definition ..... 258
9.3 Driver Methods ..... 259
- 10.1 DriverManager Overview ..... 263
10.2 DriverManager Class Definition ..... 266
10.3 DriverManager Methods ..... 266
- 11.1 DriverPropertyInfo Overview ..... 273
11.2 DriverPropertyInfo Class Definition ..... 274
11.3 DriverPropertyInfo Constructor ..... 274
11.4 DriverPropertyInfo Variables ..... 275
- 12.1 PreparedStatement Overview ..... 277
12.2 PreparedStatement Interface Definition ..... 281
12.3 PreparedStatement Methods ..... 282
- 13.1 ResultSet Overview ..... 297
13.2 ResultSet Interface Definition ..... 303
13.3 ResultSet Methods ..... 305
- 14.1 ResultSetMetaData Overview ..... 319
14.2 ResultSetMetaData Interface Definition ..... 321
14.3 ResultSetMetaData Methods ..... 321
14.4 ResultSetMetaData Fields ..... 329
- 15.1 SQLException Overview ..... 331
15.2 SQLException Class Definition ..... 333
15.3 SQLException Constructors ..... 333
15.4 SQLException Methods ..... 335
- 16.1 SQLWarning Overview ..... 337
16.2 SQLWarning Class Definition ..... 339
16.3 SQLWarning Constructors ..... 339
16.4 SQLWarning Methods ..... 341
- 17.1 Statement Overview ..... 343
17.2 Statement Interface Definition ..... 351
17.3 Statement Methods ..... 352
- 18.1 Time Overview ..... 363
18.2 Time Class Definition ..... 364
18.3 Time Constructor ..... 364
18.4 Time Methods ..... 365
- 19.1 Timestamp Overview ..... 367
19.2 Timestamp Class Definition ..... 368
19.3 Timestamp Constructors ..... 368
19.4 Timestamp Methods ..... 370
- 20.1 Overview of Class Types ..... 375
20.2 Types Class Definition ..... 376
- 21.1 Overview ..... 379
21.2 Mapping SQL Datatypes into Java ..... 379
21.3 JDBC Types ..... 381
21.4 Examples of Mapping ..... 388
21.5 Dynamic Data Access ..... 391
21.6 Tables for Type Mapping ..... 392
- 4.1 CallableStatement Overview ..... 129
- A.1 Requirements for All Drivers ..... 401
A.2 Permitted Variants ..... 409
A.3 Security Responsibilities of Drivers ..... 410
A.4 SQLExceptions ..... 413
A.5 Suggested Implementations ..... 413
- B.1 A Bit of History ..... 415
B.2 Evolution of JDBC ..... 417
B.3 Post 1.0 Changes ..... 420
B.4 The Future of JDBC ..... 421
Index ..... 431
L'auteur - Rick Cattell
is chair of the ODMG and a Distinguished Engineer in the Java Software Division of Sun Microsystems. He has been with Sun for fifteen years and before that worked for ten years at Xerox PARC and at Carnegie Mellon University. He is best known for his contributions to database systems, particularly object-oriented databases and database user interfaces. He is the author of fifty papers and five books on database systems and other topics.
L'auteur - Maydene Fisher
Maydene Fisher, a native of San Jose, specializes in object-oriented languages. She has experience spanning both coasts of the United States, having documented everything from complex financial models on Wall Street to Java APIs in Silicon Valley.
Caractéristiques techniques
PAPIER | |
Éditeur(s) | Addison Wesley |
Auteur(s) | Graham Hamilton, Rick Cattell, Maydene Fisher |
Collection | The Java series |
Parution | 03/09/1997 |
Nb. de pages | 448 |
EAN13 | 9780201309959 |
Avantages Eyrolles.com
Consultez aussi
- Les meilleures ventes en Graphisme & Photo
- Les meilleures ventes en Informatique
- Les meilleures ventes en Construction
- Les meilleures ventes en Entreprise & Droit
- Les meilleures ventes en Sciences
- Les meilleures ventes en Littérature
- Les meilleures ventes en Arts & Loisirs
- Les meilleures ventes en Vie pratique
- Les meilleures ventes en Voyage et Tourisme
- Les meilleures ventes en BD et Jeunesse