How to solve error in Sql Driver when Publish My Bonita Project ?

i want to publish Bonita Project (7.2.1) on jboss server

and in my project i call sql server to get data from database
it works in local

but when i publish it get error in sql driver

i attach sqljdbc4.jar in grrovy
but error still exist

error:sql driver class is null?

how to solve it

Update My Code in Groovy

String USER = “****”;

String PASS = “****”;

String DB_URL = “jdbc:sqlserver://172.29.29.100;databaseName=MyDB”;

String JDBC_DRIVER = “com.microsoft.sqlserver.jdbc.SQLServerDriver”;

def sql = Sql.newInstance(DB_URL, USER, PASS, JDBC_DRIVER);

Hello samehisthebest,
could you put more details on your question?

Where the error occurs?
Paste here the exact error Bonita provides to you.
Have you checked if your driver is the same the database version requires?
Where did you attached the driver jar in groovy exactly?

Cheers,
Marcos Vinícius Pinto

I suspect you have forgotten to add the sqljdbc4.jar to the {Bonitasoft_Install_Folder}\server\lib folder.

restart the portal and it should work,

regards
Seán

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

i added my code up
and error occur when i publish my Project on server

Hello!
Instead of using Sql.newInstance(), use BonitaSql.newInstance().

Cheers,
Marcos Vinicius Pinto

it’s need environment variable for BonitaSql in groovy?

No, it is a bultin made by Bonita. They encapsulated the Sql from Groovy inside his own object.

i tried it but it give error couldn’t match constructor
how i solve it

// Database credentials
String USER = “*****”;
String PASS = “****”;

  def JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  String DB_URL = "jdbc:sqlserver://100.0.0.177:1433;databaseName=db";
  
  Driver driver= 'com.microsoft.sqlserver.jdbc.SQLServerDriver'  ;

  BonitaSql nn =  BonitaSql.newInstance(DB_URL_InserTest, USER_InserTest, PASS_InserTest, driver);