use of org.apache.derbyTesting.junit.JDBCDataSource in project derby by apache.
the class cdsXid method testCreateInDatabaseName_DS.
/**
* Test that a connection to JDBCDataSource can be established
* successfully while creating a database using setDatabaseName()
* with create=true
*
* @throws SQLException
*/
public void testCreateInDatabaseName_DS() throws SQLException {
DataSource ds = JDBCDataSource.getDataSource();
String dbName = TestConfiguration.getCurrent().getDefaultDatabaseName();
JDBCDataSource.setBeanProperty(ds, "databaseName", dbName + ";create=true");
Connection c = ds.getConnection();
c.setAutoCommit(false);
c.close();
}
Aggregations