Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GeronimoTransactionManager transactionManager = (GeronimoTransactionManager) OpenEJB.getTransactionManager();
- Properties props = new Properties();
- props.setProperty("driverClassName", "com.mysql.cj.jdbc.Driver");
- props.setProperty("url", "jdbc:mysql://localhost/test");
- props.setProperty("password", "test");
- props.setProperty("passwordCipher", "PlainText");
- props.setProperty("username", "test");
- try {
- DataSource underlying = new org.apache.tomcat.jdbc.pool.DataSourceFactory().createDataSource(props);
- dataSource = new ManagedDataSource(underlying, transactionManager, transactionManager);
- } catch (Exception e) {
- e.printStackTrace();
- }
- Map properties = new HashMap<>();
- StringWriter create = new StringWriter();
- properties.put("javax.persistence.schema-generation.scripts.action", "create");
- properties.put("javax.persistence.schema-generation.scripts.create-target", create);
- Persistence.generateSchema("router", properties);
Add Comment
Please, Sign In to add comment