Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Monday, November 18, 2013

Configuring an ODBC Oracle Driver for Windows 7

My 64-bit Windows 7 laptop didn't have an Oracle driver on it when I went to create an ODBC data source.  According to the Microsoft Developer Network site, the Microsoft Oracle driver was slated to be removed and the site encouraged the use of an Oracle-provided Oracle driver.

After some searching, I came across something called the Instant Client.  I downloaded the lite Instant Client (reduced language support) and the ODBC extra download.  Here is the link.

http://www.oracle.com/technetwork/topics/winx64soft-089540.html

Once I unzipped the files, i ran the utility odbc_install AS ADMINISTRATOR.

I had expected to bring up a form in the Windows 7 Control Panel DSNS to enter all the connection information.  However, when I created the User DSN, I was only able to specify a TNS Service Listener and not a host/port/sid/username set of values.

So, I created a TNSNAMES.ORA file and saved it in alongside all of the unzipped Instant Client files.  Here is the TNSNAMES.ORA file that I created.

192.168.0.12 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(Host = 192.168.0.12)(Port = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = myoracle)
)
)

I had to tell the driver manager where to find this, so I defined a TNS_ADMIN environment variable from the Windows 7 system settings.  I pointed this to a folder -- C:/instantclient12_1 -- that contains the unzipped files and my TNSNAMES.ORA text file.

Finally, I was able to select my host/port/sid/user values which were now available through the DSN config in the control panel.

UPDATE

I'm using the ODBC Oracle Driver to pull in a database schema into SparxSystems Enterprise Architect.  The 64-bit driver didn't work, so I switched this for the 32-bit driver.  You can create the DSN within EA when you "Import DB Schema from ODBC".