How can I find out the names of the ODBC data sources available through the JDBC-ODBC driver?

John Zukowski

There is no Pure Java mechanism to get this information. If you don't mind locking yourself into the Microsoft VM, the following program demonstrates:

import com.ms.wfc.app.*;
public class ODBCSource {
  public static void main(String args[]) {
    RegistryKey regKey =
        ("SoftwareODBCODBC.INIODBC Data Sources");
    if (regKey != null) {
      String dsn[] = regKey.getValueNames();
      for(int i = 0;  i < dsn.length; i++) {