I have this bean:
public DataSource getDatsource() throws SQLException {
OracleDataSource dataSource = new OracleDataSource();
dataSource.setUser(userName);
dataSource.setPassword(password);
dataSource.setURL(wallet);
Properties props = new Properties();
props.put("AutoCommit", false); // not working
dataSource.setConnectionProperties(props );
return dataSource;
}
I would set up datasource like all the connection generated from it, has auto commit to false.
How can I do it?
PS I know -Doracle.jdbc.autoCommitSpecCompliant=false
and works, but I would set the property hard coded.
Thanks.
Solution:
public DataSource getDefaultDataSource() throws SQLException {
OracleDataSource dataSource = new OracleDataSource();
dataSource.setUser(userName);
dataSource.setPassword(password);
dataSource.setURL(wallet);
Properties props = new Properties();
props.put("oracle.jdbc.autoCommitSpecCompliant", "false");
dataSource.setConnectionProperties(props );
return dataSource;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.