Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

No suitable driver found for jdbc:sqlserver => How to connect plugin to External Postgres database

Paul-Antoine Bonlieu August 4, 2020

Hi all,

I get an issue concerning a plugin I am working on. 

I have to execute postgres request from a Jira plugin.

I had a the following dependencies in the POM.XML 

 <dependency>            

<groupId>org.postgresql</groupId>            

<artifactId>postgresql</artifactId>           

 <version>42.2.14</version>           

 <scope>provided</scope>     

   </dependency> 

When I ran the servlet to access the DB : 

try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/example", "postgres", "postgres")) 

I get the following error => No suitable driver found for jdbc:sqlserver  

Can you please help me about that ? 

In advance thank you :),

Kind regards,

PAB.

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2020

Doesn't the database driver jar have to be installed in the Tomcat, not the plugin?

Paul-Antoine Bonlieu August 4, 2020

Hi Nic, 

Thank you for your answer. 

My goal is to embed the Driver with the Jira Plugin. 

Is is possible to realize this action by configurating the Pom as I made ? 

In advance thank you,

Kind regards,

Paul.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2020

I am really very sorry, I do not know how to draw a database driver into a plugin build.

I do not know if it is even possible.  Part of my memory is insisting that if you want to connect to a database, the driver needs to be installed in Tomcat, which is something an application plugin cannot do.  I am probably wrong, I suspect there's a way to do it, but I really do not know.

But I can tell you that a mention in a pom.xml is not the right route, if it can be done, it's not that simple.

I am only familiar with installing the database connecting drivers manually in Tomcat.  (I say "familiar" - I mean "get the right .jar and copy it into tomcat/lib" - not really complex engineering there)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events