How can I find out the names of the ODBC data sources available through the JDBC-ODBC driver?
Created May 4, 2012
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 = Registry.CURRENT_USER.getSubKey ("SoftwareODBCODBC.INIODBC Data Sources"); if (regKey != null) { String dsn[] = regKey.getValueNames(); for(int i = 0; i < dsn.length; i++) { System.out.println(dsn[i]); } } } }