Java Driver Firebird 2.5 on Mac OS High Sierra - java

I cloned a Java project in NetBeans 8.2 on Mac OS High Sierra that uses a Firebird database using jars jaybird-2.2.8.jar and jaybird-full-2-2-8.jar and it works well on computers with Windows 8.2 and 10, and Linux Ubuntu 16.04. The Firebird engine that I use in the development team is 2.5.8. and Java 1.8.
Using Firebird's default tool isql in the terminal works fine and Flamerobin also works, indicating that it is installed properly.
The error it throws in NetBeans, SquirreL SQL (Java), DBeaver (Java) is as follows:
Unexpected Error occurred attempting to open an SQL connection.
class org.firebirdsql.gds.impl.GDSServerVersionException: information type inappropriate for object specified
Version string "UI-V2.5.8.27089-1 Firebird 2.5DUI-V2.5.8.27089-1 Firebird 2.5/tcp (MacBook-Air-de-Ulises.local)/P10" does not match expected format
Expected engine version format: [platform]-[type][major version].[minor version].[variant].[build number] [server name]
Any idea what causes it?

The version number reported by your Firebird installation does not match the format expected by Jaybird. The problem is the -1 in UI-V2.5.8.27089-1.
Firebird will normally report something like UI-V2.5.8.27089 ..., but the build for MacOS needed to be rebuilt due to issues with the initial build. This created a revision 1, and Jaybird does not expect that revision to be included in the version number string.
You have the following workarounds:
Install a Firebird version that does not have a -1 revision
Patch org.firebirdsql.gds.impl.GDSServerVersion and replace it in your Jaybird jar. The change you need to make is replacing
private static final Pattern VERSION_PATTERN =
Pattern.compile("((\\w{2})-(\\w)(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)) ([^-,]+)(?:[-,](.*))?");
with
private static final Pattern VERSION_PATTERN =
Pattern.compile("((\\w{2})-(\\w)(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)(?:-\\S+)?) ([^-,]+)(?:[-,](.*))?");
I have created issue JDBC-534 for this.
This has been fixed in Jaybird 3.0.5 and 2.2.15, which is available from the Firebird JDBC driver download page.
Given you were using a relatively old version of Jaybird 2.2, I do suggest you take a look at the release notes to see all changes and fixes since version 2.2.8.
Disclaimer: I maintain Jaybird.

Related

Connecting Java app with Oracle on Mac osx [duplicate]

I am trying to connect my grails project to Oracle databse(Oracle 12c) in windows(8) system. However, whenever I run my application I get following exception :
Caused by: org.apache.commons.dbcp.SQLNestedException:
Cannot create PoolableConnectionFactory (ORA-28040:
No matching authentication protocol)
Caused by:
java.sql.SQLException: ORA-28040:
No matching authentication protocol
According to internet suggestion I also tried editing my *.ora file but it is not working.
I added following snippet in sqlnet.ora file :
SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
Here i tried assigning (10,11,12) but neither of them is working.
Can anyone please help me with this ?
I deleted the ojdbc14.jar file and used ojdbc6.jar instead and it worked for me
Here is some text I found at experts-exchange:
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION
parameter has been updated to 11. This means that database clients
using pre-11g JDBC thin drivers cannot authenticate to 12.1 database
servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the
old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to
fail with the ORA-28040: No matching authentication protocol error in
12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the
oracle/network/admin/sqlnet.ora file.
This except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
If you get "ORA-01017: invalid username/password; logon denied" error, then you need to re-create your password.
I resolved this issue by using ojdbc8.jar.
Oracle 12c is compatible with ojdbc8.jar
I was using eclipse and after trying all the other answers it didn't work for me.
In the end, what worked for me was moving the ojdb7.jar to top in the Build Path. This occurs when multiple jars have conflicting same classes.
Select project in Project Explorer
Right click on Project -> Build Path -> Configure Build Path
Go to Order and Export tab and select ojdbc.jar
Click button TOP to move it to top
Very old question but providing some additional information which may help someone else. I also encountered same error and I was using ojdbc14.jar with 12.1.0.2 Oracle Database. On Oracle official web page this information is listed that which version supports which database drivers. Here is the link and it appears that with Oracle 12c and Java 7 or 8 the correct version is ojdbc7.jar.
In the ojdbc6.jar is for 11.2.0.4.
Except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
I also added the following to both the Client and Server, which resolved my issue
SQLNET.AUTHENTICATION_SERVICES = (NONE)
Also see post
ORA-28040: No matching authentication protocol
Adding
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
is the perfect solution
sql.ora directory
..\product\12.1.0\dbhome_1\NETWORK\ADMIN
My Initial error is : ORA-28040: No matching authentication protocol exception
My DB version is 12.2 (Solaris) and client version is 11.2 ( windows). I have added below in both server and client sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
while connecting, I have got invalid username and password hence I have recreated the password ( same password ) in database which is resolved my issue.
While for most cases replacing ojdbc driver jar will be the solution, my case was different.
If you are certain you are using correct ojdbc driver. Double check if you are actually connecting to the database you are thinking you are. In my case jdbc configuration (in Tomcat/conf) was pointing to different database that had different Oracle version.
just install ojdbc-full, That contains the 12.1.0.1 release.

Crystal Report error - connection with Oracle using Java

I'm migrating from Crystal report 2012 to 2020 and connecting crystal report 2020 with an oracle 19c, but when i try to connect my application (using Java) with Crystal Report Java gives me an error. Specifically:
Connection error: The oracle url is not valid
but in the logs I saw that is using the correct url
Connection logon:Database DLL=s(crdb_jdbc.dll);Use JDBC=b(true);Connection URL=s(jdbc:oracle:thin:{userid}/{password}#serverName:1521:dataBaseSID);Database Class Name=s(oracle.jdbc.driver.OracleDriver);Server=s(serverName);Trusted_Connection=b(false);JDBC Connection String=s(!oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:{userid}/{password}#serverName:1521:dataBaseSID);PreQEServerName=s(jdbc:oracle:thin:{userid}/{password}#serverName:1521:dataBaseSID);database=s();User ID=s(testUserDB);Password=
I tried many url configurations like
jdbc:oracle:thin:{userid}/{password}#//serverName:1521/dataBaseServices
jdbc:oracle:thin:#serverName:1521:dataBaseSID
jdbc:oracle:thin:#//serverName:1521:dataBaseSID
jdbc:oracle:thin:#serverName:1521/dataBaseServices
jdbc:oracle:thin:#//serverName:1521/dataBaseServices
but none of these work, and I don't know what is causing the error.
The curious part is that if I try any of those urls with, with crystal report 2020, they work perfectly - but with java I receive the url error.
I also try to change the class name from oracle.jdbc.driver.OracleDriver to oracle.jdbc.OracleDriver but without lucky.
the line that is giving the error is:
reportClientDocument.getDatabaseController().logon("testUserDB", "passwordBD");
the class report client document use this library com.crystaldecisions.reports.sdk.ReportClientDocument; I tried to change that library for com.crystaldecisions.sdk.occa.report.application.ReportClientDocument and I had the same error.
I'm using Spring Tool Suite 4 as IDE that is base on eclipse 4.15.0, JDK 1.8 and ojdbc8 (connector to oracle 19c)
I already downloaded the libraries, features and plugins of Crystal Reports for Eclipse SP27 and installed in my environment and even with that, |I still have the same problem.
See the following post: Java JDBC - How to connect to Oracle using Service Name instead of SID
The correct format you should use is the following:
jdbc:oracle:thin:#//<host>:<port>/<service>
So, for example:
jdbc:oracle:thin:scott/tiger#//myhost:1521/myservicename
jdbc:oracle:thin:userId/Password#//servername:1521/dataBaseService
You could also try the TNS format:
jdbc:oracle:thin:#(description=(address=(host=HOSTNAME)(protocol=tcp)(port=PORT))(connect_data=(service_name=SERVICENAME)(server=SHARED)))

Pentaho - Unable to create a database connection

When I go to create a Database Connection in Kettle I am getting the exact same errors as in this question: Kettle / Pentaho Data Integration - unable to create a Database Connection (XulException: java.lang.reflect.InvocationTargetException)
org.pentaho.ui.xul.XulException: java.lang.reflect.InvocationTargetException
And after clicking OK there is this message:
General error in dialog
The difference for me being that I seem to be using the correct Java. I have upgraded to PDI 9.1 and according to the documentation Java 8 is still the only supported Java.
My Config:
MacOS 10.15.7 (Catalina)
Pentaho Data Integration (or Kettle) 9.1.0.0-324
Java jdk1.8.0_161.jdk
What else have I tried?
I cleared my cache as described in the comments below.
I updated my SWT as described in this tread: PDI will not start under MacOS Catalina 10.15
I changed my Java 8 build to jkd1.8.0_202.jdk per this thread: Issue while accessing DB Connections- PDI 8

Error linking JNA library on AdoptOpenJDK on MacOS

I am trying to run some JUnit tests over cassandra. But I get the following error:
[08/12/19 10:48:40:411](main)([]) INFO - c.h.c.c.e.EmbeddedCassandra - Starting embedded Cassandra server.
8/12/19 10:48:41:497](main)([]) ERROR - o.a.c.u.NativeLibraryDarwin - Failed to link the C library against JNA. Native methods will be unavailable.
java.lang.UnsatisfiedLinkError: /private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: dlopen(/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp, 1): no suitable image found. Did find:
/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp: code signature in (/private/var/folders/ty/wl4gxf352m328101m101hwh40000gn/T/jna--321969061/jna10641195286884112036.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
It was running well until I changed to mac mojave and re-setup everything. I think it is an issue related to permissions may be or JNA?
IDE: IntelliJ
Java: AdoptOpenJDK 11.0.4
JNA: 4.2.2
Any kind of help will be highly appreciated!
This is the result of a bug in AdoptOpenJDK jdk-11.0.4+11 on macOS, persisting through 11.2.
It will be fixed in the jdk-11.0.4+11.3 release.
If you can't wait for the new release you can temporarily resolve by downgrading to 11.0.3+7
What version of cassandra unit? Support for java 11 (https://issues.apache.org/jira/browse/CASSANDRA-9608) isn't in until cassandra 4 and I dont think embedded cassandra is setup for that yet

Problems with updating cassandra database and java problems

I was trying to upgrade my cassandra 1.2.13 to cassandra 2.0.5 but I was having some issues. I was follwing the instructions here:
https://github.com/apache/cassandra/blob/trunk/NEWS.txt
it says:
2.0.5
=====
...
Upgrading
---------
- If your cluster began on a version before 1.2, check that your secondary
index SSTables are on version 'ic' before upgrading. If not, run
'nodetool upgradesstables' if on 1.2.14 or later, or run 'nodetool
upgradesstables ks cf' with the keyspace and secondary index named
explicitly otherwise...
So since I have not initialized anything (any tables/kspaces and stuff) that matters I did:
nodetool upgradesstables
However when I do that command the following error is thrown at me:
objc[88756]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
I tried googling that error but was still unsure how to proceed. Does someone know how to fix this without screwing up java environment?
I have a MAC OS X 10.9.1
it's a bug in JDK 1.7.0_45. you must upgrade your jdk.
see also Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined

Categories

Resources