How can I find out the names of the ODBC data sources available through the JDBC-ODBC driver?
Location: http://www.jguru.com/faq/view.jsp?EID=94778 Created: Jul 5, 2000 Modified: 2000-07-05 07:29:28.011 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) 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 (“Software\\ODBC\\ODBC.INI\\ODBC Data Sources”); if (regKey != null) { String dsn[] = regKey.getValueNames(); for(int i = 0; i < dsn.length; i++) { System.out.
Related Questions
- CONNX has been fully rearchitected to support multiple, heterogeneous data sources from a single ODBC driver, and to enable you to quickly add new data sources. Why is this important?
- How can I connect to an ODBC data source without setting up a DSN in ODBC Driver Manager (Control Panel)?
- How can I find out the names of the ODBC data sources available through the JDBC-ODBC driver?