Question

I'm using IBM RAD 7.5.5 (which is basically eclipse 3.4 (ganymede) + plugins).

I'm trying to create a connection to Oracle 10 using the "Data Source Explorer" view.

When I create a new connection for Oracle, there are three "driver" options:

  1. "Oracle 10 - Oracle OCI Driver Default"

  2. "Oracle 10 - Oracle Thin Driver Default"

  3. "Oracle 10 - Other Driver Default"

1 & 2 don't work for me because I need to connect to the db using a "Service Name", not an "SID". The dialog box does not give me the option of specifying a Service Name, and it does not allow me to manually specify the connection URL. (Service Name has a different URL syntax, uses a '\' instead of a ':", like so ...

With SID: jdbc:oracle:oci:@localhost:1521:the_sid

With Service Name: jdbc:oracle:oci:@localhost:1521\the_sevrice_name

So ... I want to use option #3 which allows me to specify the URL manually. The problem is I add the driver file ojdbc14.jar to the JAR list, but it keeps telling me "Invalid JAR definition; driver list not defined".

Can anyone help? I'm really stuck on this. :(

Thanks, Rob

Was it helpful?

Solution

FYI, at long last I found a solution to my problem.

While I was never able to establish the connection with the "Service Name" using Eclipse/DTP "Data Source Explorer", I was able to establish the connection with "Service Name" using SQL Developer. Once connected with SQL Developer, I did a ...

select sys_context ('userenv','instance_name') from dual; 

... to determine the database's SID.

With the SID I was able to connect with option #1 and the driver contained in ojdbc14.jar.

Thanks all, Rob

OTHER TIPS

If you are stuck with a more recent version of Oracle (e.g. Oracle 12) on a recent RAD or Eclipse installation you should try to do the following:

  • Download the Oracle 12 ojdbc7.jar. If you are on java6 you should download ojdbc6.jar
  • Create a new connection
  • Select Oracle 12 - Other Driver Default
  • Press the [...] dot, remove the default ojdbc6.jar and add the jar you downloaded before
  • Insert database name, the url (as jdbc:oracle:thin:@server:port/service ), the username and password, check the save password box if you wish.
  • Click Next and then Finish. Eclipse will try to test the connection, if the driver is still giving you problems then you need to force Eclipse (or RAD) to save the connection and you can fix it later.

Now you can fix the driver properties. This step is necessary to eventually be able to call the thin client in the jar.

  • In the database connection list choose the new connection you just created and press right button > properties
  • Choose Driver Properties
  • Click on the delta icon (the small triangle) near the Drivers combo box.
  • Open the Properties tab, then edit the properties as follow:
  • Catalog - USER
  • connection url - jdbc:oracle:thin:@server:port/service
  • Database Name - db
  • Driver Class - oracle.jdbc.driver.OracleDriver
  • Now your connection test should be succesful.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top