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

1
0
-1

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);

2 answers

1
0
-1

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.

1
0
-1

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

Comments

Submitted by samehisthebest on Sun, 02/12/2017 - 13:11

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

Submitted by mvpdev on Sun, 02/12/2017 - 14:58

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

Cheers,
Marcos Vinicius Pinto

Submitted by samehisthebest on Sun, 02/12/2017 - 15:06

it's need environment variable for BonitaSql in groovy?

Submitted by mvpdev on Sun, 02/12/2017 - 15:12

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

Submitted by samehisthebest on Mon, 02/13/2017 - 10:45

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

Submitted by samehisthebest on Mon, 02/13/2017 - 11:27

// 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);
Notifications