Marco Rietveld [
http://community.jboss.org/people/marco.rietveld] created the discussion
"Re: jBPM 5.1 with SQL Server"
To view the discussion, visit:
http://community.jboss.org/message/629585#629585
--------------------------------------------------------------
Dominique,
You're almost there!
See
https://github.com/droolsjbpm/drools/blob/master/drools-persistence-jpa/s...
here for the all of the code from the following segment, but the following should work for
SQL server:
PoolingDataSource pds = new PoolingDataSource();
// The name must match what's in the persistence.xml!
pds.setUniqueName("jdbc/testDS1");
//
pds.setClassName("com.microsoft.sqlserver.jdbc.SQLServerXADataSource");
// doesn't really matter
pds.setMaxPoolSize(3);
pds.getDriverProperties().put("user", "thisIsMyUsername");
pds.getDriverProperties().put("password", "thisIsMyPassword");
for (String propertyName : new String[] { "serverName", "portNumber",
"databaseName" })
pds.getDriverProperties().put("serverName",
"The.Server.Name.as.in.DNS.Name");
pds.getDriverProperties().put("portNumber", "portNumber);
pds.getDriverProperties().put("databaseName", "NameOfTheDatabase");
pds.getDriverProperties().put("URL", "jdbcUrl");
pds.getDriverProperties().put("selectMethod", "cursor");
pds.getDriverProperties().put("InstanceName",
"ThisIsTheInstanceNameOfYourDatabase-sortOfLikeTheDatabaseName");
pds.init();
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("persistenceUnitName");
Also, the jta-data-source element should +not+ be commented out in your persistence.xml,
obviously.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/629585#629585]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]