![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]()
(chat, newsreader, calendar)
|
![]() |
|
Course Notes Table of Contents | Exercises JDBC Short Course Index | Online Training Index
|
Help: Using JDBCTest |
Working Applet | Help Solution
|
Help is available for each task, or you can go straight to the
source code, which is one particular
solution.
Run JDBCTest. (java JDBCTest). Ensure the JDBCTest package is installed, and the classes are in CLASSPATH.
To connect to the database, you need to first register the JDBC driver. You are going to use the JDBC-ODBC bridge provided with the JDK, but you can get drivers for non ODBC sources. From the main screen, select Register Driver, under the Driver menu.
Once you have registered the driver, you can use it to connect to the database. Select Connect to DB under the Connection menu. This brings up the Select A Database window. To connect to the datasource use the URL in the Database text field. When you use the JDBC-ODBC bridge, the URL begins with the string jdbc:odbc: followed by the datasource name. If using a different driver, the URL still begins with jdbc:, but the remainder of the URL is specific to the driver. Change the string dBASEfile to the name of the datasource you are using. Enter a username and password if necessary.
|
Copyright © 1997 MageLang Institute. All Rights Reserved May-97 Copyright © 1996, 1997 Sun Microsystems Inc. All Rights Reserved |