[jboss-user] [jBPM] - Re: jBPM 5.1 with SQL Server
Marco Rietveld
do-not-reply at jboss.com
Fri Sep 30 10:54:55 EDT 2011
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/src/test/java/org/drools/persistence/util/PersistenceUtil.java 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&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110930/9728a093/attachment.html
More information about the jboss-user
mailing list