Groovy & Postgresql

1
0
-1

Hello,

I've got this error in my groovy script :

unable to resolve class org.postgresql.Driver

import groovy.sql.Sql;
import java.sql.Driver;

Sql sql = BonitaSql.newInstance("jdbc:postgresql://localhost:5432/postgres","postgres", "admin", new org.postgresql.Driver());

Thanks for your help.

Comments

Submitted by antoine.mottier on Thu, 01/04/2018 - 16:40

Note that it's usually recommended to use the data source connector to access database as you can benefit from connection pooling feature that lead to better performances.

I don't know if this is your use case, but note that it's not recommended to directly query Bonita Engine database but rather use the APIs. APIs are stable between each version of Bonita whereas the database schema might change.

1 answer

1
0
-1

Have you copied the postgresql JAR to the lib directory, if so have you restarted the server/studio?

regards
Seán

PS: As this reply answers your question, please mark as resolved.

Comments

Submitted by patrick.turgy on Fri, 01/05/2018 - 08:28

Hi,

After a copy of postgresql JAR to the lib directory, all is fine.

Thanks a lot for the answer but also for the comment (to better performances).

Patrick.

Notifications