Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Quick-and-dirty Java programming: Setting up a data source for JDBC

Return to article.

The sample programs in this article are set up so you can use them with the widely available mySQL OpenSource RDBMS server. By simply changing the driver and connection URL, you can get the sample to work with your own RDBMS. I have provided an MS Access-compatible MDB file for those who would like to use the JDBC-ODBC bridge provided as part of the Win32 distribution of the JDK. You will find the database file in the source distribution as fesitest.mdb. To modify the samples for using with this database, follow these steps:

  1. Using the ODBC-32 applet in the Control Panel, set up a system data source named devworks to point to the fesitest.mdb file

  2. Change the JDBC driver in the sample program to use sun.jdbc.odbc.JdbcOdbcDriver

  3. Change the Connection URL in the sample program to use jdbc:odbc:devworks

When you run the DBScriptFlex.es example, be sure to modify the SQLcmds dbinit.ini entry to msDBPop.sql. This is necessary because the DDL varies between mySQL and MS Access. If you want to run DBScript.es under MS Access, you must modify the Create Table statement according to the content of msDBPop.sql. GUIViewer.es should work fine with MS Access once you have changed the JDBC driver and URL.

Return to article.