JDBC Technology Code Samples
JDBC Technology is an API that lets you invoke SQL commands to create database tables, access the data stored in a table, and create and manage distributed transaction. Prior to J2SE 1.4, you have to download the javax.sql package for distributed transactions separately.
- BatchUpdate.java updates the database with a list of items using the PreparedStatement and CallableStatement classes. For supporting information see The Java Tutorial: JDBC Basics
- CreateCoffees.java creates a table named COFFEES with 5 fields. For supporting information see The Java Tutorial: JDBC Basics
- MetaTest.java connects to a database and displays information about the database and driver used to make the connection. For supporting information see New to Java Programming Supplement, June 2002.
- OutputApplet.java is an applet version of the coffee application. For supporting information see The Java Tutorial: JDBC Basics
- TransactionPairs.java shows how to back out a transaction that posts to two different columns in the same table. For supporting information see The Java Tutorial: JDBC Basics