How can I tell SQLDeveloper which version of JDBC to use? - oracle-sqldeveloper

I need to connect to an Oracle 9i server from my machine using SQLDeveloper. I already have a functioning version of SQLDeveloper 18.2 + Oracle Client 12 for more modern databases, but for this connection I want a separate older version of SQLDeveloper.
I've installed SQLDeveloper 3.2.20.09 in a separate folder on my machine and can launch it, but it defaults to finding the ojdbc6.jar file from Oracle Client 12. if I go to Help > About and select properties, the jdbc.library says jdbc.library /C:/app/client/product/12.1.0/client_1/jdbc/lib/ojdbc6.jar
and if I try to connect I get the error ORA-01460: unimplemented or unreasonable conversion requested
I tried putting the path to the SQL Developer 3.2 install first in the PATH variable, but no difference. Is there a way to tell SQL Developer which jdbc driver to use for Oracle ? (maybe in sqldeveloper.conf)

The official answer is:
use the jar (driver) we ship with the product OR
use a Thick Client, and we'll pull the jdbc driver from an Instant Client or Oracle HOME on your machine
The 2nd option will work so long as you don't try to go back back or forward in time to the point that the software will recognize/support the driver.
In other words, you can't tell SQL Developer 18.x to use a 9i Home, we have a hard dependency to require at least a 11gR2 client (I believe, it could actually be a 12c based client which is required).
You'd be better off getting your data out of that ancier 9i Database and into a modern 12 or 19c Oracle instance.
but it defaults to finding the ojdbc6.jar file from Oracle Client 12.
Sounds like you've managed to get a thick connection defined, go into preferences and disabled on the advanced page any reference to OCI or Thick, then it will use the jdbc driver shipped with SQLDev.

Related

How to change default JDBC driver of Oracle SQL Developer?

I have an old Oracle 9i r2 database. The last JDBC driver that I managed to make work with it is ojdbc6 11.2.0.4. This keeps me stuck to SQL Developer 4.0.3. I would like to benefit from features of newer versions of SQL Developer. But they use newer driver like ojdbc8.
Is there a way to use old drivers with new versions of SQL Developer? The option to add third party JDBC drivers only work to add drivers for other databases like db2 or sql server.
I tried to delete the recent driver and replace it by an older one but SQL Developer malfunctions.
For SQL Developer version 20.2.0 on Windows 10 do:
Download and unzip SQL Developer version 20.2.0
Download and unzip Oracle Instant Client 11.2.0.4.0
Configure SQL Developer to use above instant client:
Tools > Preferences... > Database > Advanced
Mark "Use Oracle Client" > Configure...
In "Client Type" select "Instant Client"
In "Client Location" point to where you unziped instant client
Click "Test...". The log panel should show something like
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
OK > restart SQL Developer
Configure connection:
Just create a normal connection
In "Advanced" tab add the key oracle.jdbc.timezoneAsRegion with value false. This avoids
ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found
This procedure enables you to use a more recent SQL Developer version with an old Oracle 9i r2 without hanging on connect or getting
ORA-01460: unimplemented or unreasonable conversion requested
every time you click something.

DB2 connectivity without client drivers

I'm using EF 6 (Code first) with the IBM.Data.DB2.EntityFramwork nuget package to access a db2 database server. Working locally it all works as expected, but when deployed to a test server I get an exception: "System.MissingMethodException: Method not found: 'Void IBM.Data.DB2.InternalStruct6.SetDefault()"
I'm no DB2 wizard but I think the issue is related to a incompatible version of the db2 client drivers installed on the test server (9.7?). Entity framework 6 support needs version > 10.5. (I must have installed the 10.5 version locally at some point).
It would be nice to be able to run the application on any pc without additional dependencies, so my question is: Are there any way of skipping the db2 clients/drivers installation, and rather reference certain db2 dll's (or other nuget packages), to access db2 db servers?
Ok, I think asking the question resulted in a moment of enlightenment.
I guess the answer is NO, as the db2 clients/drivers actually installs the db2 odbc data source driver for db2. (Located in Administrative Tools -> Data Sources (ODBC)).

sonarqube 4 server migration

I'm trying to move a sonarqube 4.4 installation from one machine to another. What's more we would also like to change the database server from Oracle to Postgres 9.3.
What my plan was initially is that I would shutdown the sonar server, the database adminstrator would dump existing database, migrate it to postgres in the new server and I would zip the existing server installation and move it along to the new server. Then I would start the server.
However I've run into problems, even though sonarqube 4.4 booted fine, when I hit
http://new-server:9001/sonar4
I was getting a 404 response from sonar.
At some point I tried unzipping the server file anew in which case I managed to see the projects and the dashboards but no analysis data existed, even though last analysis time was available.
Any ideas or clues what am I missing?
Also, the driver in sonarqube for postgres is 9.1.xxx can I update this or should we use postgres 9.1 to make sure the driver is compatible with the database?
How is your ..\conf\sonar.properties? Normally, you should have changed:
sonar.jdbc.url=jdbc:oracle:thin:#localhost/XE
Did you use some tool to migrate Oracle to Postgress? I thought it was not possible.
Do not hesitate to ask for further precision.
Regards.

Oracle Driver Installation

I am having Oracle 10g installed on my laptop and have downloaded ojdbc14.jar driver for the same. The problem is, my operating system is Windows 7, and I'm not having option to create a Data Source for Oracle since I m not having oracles driver installed. I m having option to create a Data Source for SQL server 6, but I want to get connected to Oracle. Please Help.
By 'Data Sources', I'm guessing that you mean Data Sources (ODBC), under Control Panel > Administrative Tools. Is this correct?
I've set up ODBC Data Sources that connect to Oracle databases before, but to do that I've needed the Oracle client to be installed. However, if you're having the full database installed on your laptop (as your question suggests), you won't need the client - that's only used to connect to databases running on other machines. I believe the full database contains everything in the client, so you should be able to set up an ODBC Data Source pointing to the database on your laptop once the database has been installed.
The ojdbc14.jar just contains the JDBC classes to talk to an Oracle database, and only programs written in Java (and other languages that run on the JVM such as Scala, Groovy or Clojure) can use it. This jar on its own not enough to be able to set up an ODBC data source.
Oracle currently has 1 version that is certified for windows 7. That version is 11.2. They have indicated that they plan to certify 10.2.0.5 if this happens there will likely be a patch that will be needed.
This is probably why the Data Source does not work, either ODBC or OLEDB.
Another possibility is that you have installed the 32bit version of Oracle and your OS is 64bit then you would need to use the 32bit Data Source administrative tools.
I have figured out the solution for my problem. All that I needed to do is put ojdbc14.jar file in my class path and then I was able to use it. Though by doing so, I needed to make some change in the code. I was no more able to use Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") instead I needed to use Class.forName("oracle.jdbc.OracleDriver") also instead of using my data source as "jdbc:odbc:somename" I needed to use jdbc:oracle:thin:#localhost:1521:xe.

IBM DB2 Type 4 driver?

Where can I find the redistributable version of the IBM DB2 Type 4 driver?
I suppose this is the driver I would use to connect from a Java app (on windows) to DB2 on the mainframe?
You will not be able to connect to the mainframe with any redistributable JDBC driver. The driver pack consists of the actual type 4 driver (db2jcc.jar) and any number of license files of the form:
db2jcc_license_cisuz.jar
where the cisuz bit is variable, indicating the platforms that you're allowed to run on (iSeries, pSeries, System z, LUW and so on).
You're only likely to get cu with any freely distributable pack. You need the z to access DB2 on the mainframe and that's jealously guarded so you'll need to purchase a specific edition of DB2 Connect to get it. I think both PE and EE, the personal and enterprise editions, have this licence file.
Without that license file, the type 4 driver won't even try to talk to the server, you'll get an exception.
IBM's Fix pack site has the "IBM Data Server Driver for JDBC and SQLJ" which is nothing but the JDBC type 4 driver. Though the page I pointed to above happens to be the windows page, it's the same type 4 driver for all platforms, as should be expected.
I don't think any user/password is required.
There is no need to download the JDBC driver separately it is already shipped with your DB2 product.
You can easily find it at this location : C:\Program Files\IBM\SQLLIB\java\db2jcc.jar
db2jcc.jar is the driver name
You can get the drivers from the IBM site. You will need to have IBM ID and password to login (which you can obtain here). Zip file is about 7 MBs, in contains DB2 9.5 JDBC (type 2/4) and SQLJ drivers. Type 4 drivers are in db2jcc4.jar.
However, you won't be able to connect to mainframes with this driver if mainframe is running DB2 for z/OS. To do so, you need at least to purchase DB2 Connect product, which will cost you about $500 minimum.
If you're running on an AS/400 (or iSeries, or whatever the heck IBM is calling it these days), you'll probably want to get it from JTOpen.
Their toolbox replaces the old Java Toolbox and includes the JDBC drivers.
If I need any IBM JARs for DB2 or MQ, I usually just add it to the instructions that DB2 or MQ needs to be installed as a prerequisite along with a URL to download it.
The same goes for Java and many other not easily redistributable products as well.
This eliminates the need to worry about licensing issues as it would be on the onus of the user rather than the vendor to obtain the proper licenses.