• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Making an ODBC connection through System DSN set up under Windows ODBC Data Source Administrator?

'm trying to make an ODBC connection in Java through Windows ODBC Manager. I have managed to read the registry to get a listing of System DSNs and once a selection is made by the user I read the "HostMachine" parameter in the registry associated with the selected SystemDSN and from there I want to make that ODBC connection. I have tried the DriverManager getConnection method but it doesn't seem to work! Any ideas PLZ??!

Please note that I want to access the servers through their associated IP addresses and less likely urls, hence (HostMachine)!

Also each of these System DSNs are associated with a driver that would need to be used to connect its related data source!
0
snajalm
Asked:
snajalm
  • 2
  • 2
1 Solution
 
CEHJCommented:
You probably need to make the connections through registry writes. I would examine the registry at each step, as you move from finding candidates to actually making the connection *manually*
0
 
CEHJCommented:
Check out the Windows docs too. Perhaps the following might be of help:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms714818(v=vs.85).aspx
0
 
snajalmAuthor Commented:
I used JDBC-ODBC driver and included the values retrieved from registry in the following lines of code!

String url = "jdbc:odbc:" + address + ";user=" + username + ";password=" + password;
DriverManager.getConnection(url);
0
 
snajalmAuthor Commented:
It finally got solved!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now