Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc. using database postgres - postgresql

I am working on report using BIRT with postgresql. While I am able to run the report successfully using BIRT viewer, when I try to integrate with tomcat, it gives the below error-
Cannot open the connection for the driver:
org.eclipse.birt.report.data.oda.jdbc.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot load JDBC Driver class: org.postgresql.Driver.
while I have place the oda.jdbc.driver "postgresql-42.2.5" at location "\WEB-INF\lib" but still I'm facing this error.
I am running:
Birt version:-4.8.0
postgres version:- postgres9.5 (1.22.2)

After viewing error it seems the the JDBC driver jar is on at class path into BIRT runtime so it is not able to load the Driver and throwing error.
Please ensure the Driver jars are placed into libs directory of BIRT runtime installed in your server and it is available into class path at runtime.

Related

No Suitable driver exception when I try to connect to postgres using the jdbc step in SoapUI (free version)

I am sorry this question was asked many times.
Steps that I followed are as follows
downloaded the postgres jdbc driver from the following link
https://jdbc.postgresql.org/download.html
downloaded the latest version
Pasted the jar file in the soapui_home/bin/ext folder
Restarted SoapUI still getting the same error
I have added a jdbc step in SoapUI
Here is the driver, I have used PostgreSQL/org.postgresql.Driver
The string is dbc:postgresql://localhost:5432/databaseName?user=username&password=password
Environment
Redhat Linux
jdk version is 11
SoapUI version 5.7.0
Changed the driver string in the jdbc step to org.postgresql.Driver. It started working.

Eclipse - MariaDB JDBC onnection issue (bug or I messed up something?)

I started learning Java EE, and I decided to develop my small application in simulated "real world production" environment:
I decoupled the development and deployment environment into a laptop (with Eclipse IDE) and a server (Raspberry Pi with Tomcat/TomEE and MariaDB).
With this environment I can learn not only EE development but the deployment phase, too.
The problem
After installation of MariaDB I realized that the MariaDB's JDBC connector doesn't work properly. I successfully made a connection in Eclipse via Generic JDBC (I used MariaDB's default connector). Pinging the server was also successful, but every query returned void results.
I tried the following queries:
show tables in dbName;
select * from tableName;
show databases;
When I tried to make entities from tables in a new JPA project, Eclipse didn't offered any tables.
Can somebody please help me to make a complete working connection to MariaDB.
What did I try (until this moment, without result)?
Updated the Raspbian system by apt-get update, moreover I did the same after installing MariaDB.
Tried to install MySql 5.6 with apt-get and dpkg, but the armhf version is not available on Raspbian Stretch
In Eclipse's Preferences/Data Management/Connectivity/Driver Definitions I tried to install MySql driver instead Generic JDBC
In properties (in Edit Driver Definition) tried the following Connection URL-s:
jdbc:mysql://hostName:port/
jdbc:mariadb://hostName:port/
jdbc:mysql://hostName:port/dbName
jdbc:mariadb://hostName:port/dbName
jdbc:mysql://hostName:port/dbName?user=userName&password=password
jdbc:mariadb://hostName:port/dbName?user=userName&password=password
Tried older version of JDBC connectors, too (mariadb-java-client-2.1.0.jar), without good result.
I installed MySQL on local machine, I could connect it in Eclipse successfully.
I could successfully connect, create, insert, alter tables in MariaDB from locally installed MySqlWorkbench.
I installed MariaDB on local machine. Despite the connection ping was successful in Eclipse, the void query result was the same as the remote MariaDB connection.
I installed NetBeans to check whether I can connect MariaDB with it's driver. The result was SUCCESS (screenshot is attached)
One more weird thing: in Data Source Explorer the tree structure is different between MySQL and MariaDB (see the screenshot)
The environment
Server:
Raspbian Stretch (Debian 9.1)
Java: openJKD 1.8.0_141, OpenJDK Runtime Environment build 1.8.0_141-8u141-b15-1~deb9ul-b15, OpenJDK Zero VM build 25.141-b15-1~deb9ul-b15
MariaDB Ver 15.1 Distrib 10.1.23-MariaDB, for debian-linux-gnueabihf (armv71)
Local machine:
Windows 10 Pro 64bit, version: 1703, build: 15063.674 (Hungarian language local)
MySqlWorkbench 6.3CE, 6.3.9 build 10690321 CE(64 bits)
Eclipse Neon.3 Release (4.6.3), Build id: 20170314-1500
NetBeans IDE 8.2, Build 201705191307
Java: JDK 1.8.0_151 (x86_64 architecture)
JDBC: mariadb-java-client-2.1.2.jar (This worked successfully with NetBeans)
To summarize, in Eclipse I can make a connection to MariaDB via Generic JDBC, the ping is successful, but I cannot get any result from queries (and cannot generate entities from tables).
Solved:
In Eclipse you don't have to use MariaDB's JDBC 2.1.2. connector. It is fully MySQL compatible just use MySQL JDBC 5.1 default (mysql-connector-java-5.1.41-bin.jar). Now it works fine!

Wildfly JDBC for Postgres

In order to deploy an application in Wildfly I needed to setup a JDBC module for database connection so I deployed the JDBC driver
After that, I added a datasource.
The problem I found no postgresql driver:
Any idea how to solve this?
I'm using Wildfly 10 and PostgreSQL 9.5 with Java 7
You didn't deploy the driver as a module but as a deployment. You have to create the module manually or use the jboss-cli like this:
module add --name=org.postgres --resources=/tmp/postgresql-version.jar --dependencies=javax.api,javax.transaction.api
Then register the module as a JDBC driver like this :
/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
Then you'll be able to create your datasource.

Ireport - JasperServer: PostgreSQL error (Driver)

I am trying to run my report created on iReport 4 on the jasperserver with a postgresql database (On my localhost).
The report runs perfect on the preview on iReport. Now when I upload it to the jasperServer I get the following error:
1 - org.postgresql.Driver
java.lang.Exception: 1 - org.postgresql.Driver 
at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:403) 
at com.jaspersoft.ireport.jasperserver.ws.WSClient.runReport(WSClient.java:320) 
at com.jaspersoft.ireport.jasperserver.ReportRunner.run(ReportRunner.java:70) 
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) 
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)
Then I checked my OLAP settings on my jasperServer and noticed it doesn't have a postgresql driver.
mondrian.jdbcDrivers
sun.jdbc.odbc.JdbcOdbcDriver,org.hsqldb.jdbcDriver,oracle.jdbc.OracleDriver,com.mysql.jdbc.Driver
And on my jasperreport I use the following driver:
PostgreSQL (org.postgresql.Driver)
I think this is the problem. Does anyone know how I can add this postgresql driver to my jasperserver?
Or is there a different problem?
The PostgreSQL driver jar should go into the lib directory of your application server.
If you are using the bundled version of tomcat that comes with jasperServer, this will be
<jasperServer_install>\apache-tomcat\lib
More detailed instructions are available here.

Error connecting to PostgreSQL from Server Explorer - Could not load file or assembly, Version=4.0.4.1 'System.Runtime.CompilerServices.Unsafe'

I am trying to connect PostgreSQL from .net core Server Explorer using Npgsql 4.1.1. But it is throwing exception Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe'.
I tried installing earlier version of Npgsql but, still the same exception.