How to connect a service to an external database?

I’m trying to develop new custom modules for JIRA instance.
For that I need a connection to an external database.
On the code view I have something like that:

private void initConnection()throws SQLException{
    if(this.conn != null && this.conn.isClosed()){
    String host = this.customConfig.getHost()+":"+this.customConfig.getPort();
    String url = "jdbc:postgresql://"+host+"/"+this.customConfig.getDatabase();
    Properties props = new Properties();
    this.conn = DriverManager.getConnection(url, props);

Last line throw this error : java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/db-dev
Someone to help me ?

Add the sql driver file to your plugin lib folder or path.

Hi @saurabh.gupta ,

I already try your solution based on but that doesn’t work.

And my Jira server work already with a postgresql database, so the driver is already on it.

Jira has most of the required drivers, but then the questions comes are you able to access that driver.