简体   繁体   中英

No suitable driver found for jdbc:postgresql://localhost:5432/postgres

I tried several tutorials that I could get my hands on, but all of them lead to the same error:

18:28:24,583 INFO [stdout] (default task-1) Database error :No suitable driver found for JDBC:postgresql://localhost:5432/postgres

I have configured the connection following this tutorial: HOW TO SETUP POSTGRESQL DATASOURCE WITH WILDFLY

and tried several ways to fix the problem. I have tried both the management console and the configuration file. The most common solution was trying to add the postgresql-42.2.24.jar to the project structures in modules, but that doesn't solve it. I have created a new simple Java project where I am just trying to connect to the database and it works (I used the same credentials in both places), but when I'm trying to link the server with the DB it's like it doesn't see the driver... When adding a Datasource from Intellij it works perfectly fine (it sees the tables, I can run queries and everything), but I can't get the connection with the server to work. I'm using Wildfly 24.0.1 Final and Java 8.

JDBC更改为jdbc ,它区分大小写。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM