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:

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++) { 
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact