View Source

h3.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|http://java.sun.com/docs/books/tutorial/jdbc/basics/examples/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|http://java.sun.com/docs/books/tutorial/jdbc/basics/]

* [CreateCoffees.java|http://java.sun.com/docs/books/tutorial/jdbc/basics/examples/CreateCoffees.java] creates a table named {{COFFEES}} with 5 fields. For supporting information see [The Java Tutorial: JDBC Basics|http://java.sun.com/docs/books/tutorial/jdbc/basics/]


* [MetaTest.java|http://java.sun.com/new2java/supplements/solutions/June02.html] 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|http://java.sun.com/new2java/supplements/2002/June02.html].

* [OutputApplet.java|http://java.sun.com/docs/books/tutorial/jdbc/basics/examples/OutputApplet.java] is an applet version of the coffee application. For supporting information see [The Java Tutorial: JDBC Basics|http://java.sun.com/docs/books/tutorial/jdbc/basics/]

* [TransactionPairs.java|http://java.sun.com/docs/books/tutorial/jdbc/basics/examples/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|http://java.sun.com/docs/books/tutorial/jdbc/basics/]
----

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact