Java 将oracleDataSource更改为PostgreSQL
我有这个功能Java 将oracleDataSource更改为PostgreSQL,java,oracle,postgresql,Java,Oracle,Postgresql,我有这个功能 public OracleDataSource dataSource() throws SQLException { if (dataSource == null) { dataSource = new OracleDataSource(); dataSource.setUser(username); dataSource.setPassword(password); d
public OracleDataSource dataSource() throws SQLException {
if (dataSource == null) {
dataSource = new OracleDataSource();
dataSource.setUser(username);
dataSource.setPassword(password);
dataSource.setURL(url);
dataSource.setImplicitCachingEnabled(true);
dataSource.setFastConnectionFailoverEnabled(true);
}
return dataSource;
}
我需要更改从oracle到postresql db的交换,OracleDataSource中有一些等价物用于Postrgesql?有
org.postgresql.ds.PGConnectionPoolDataSource
和org.postgresql.ds.PGSimpleDataSource
有关详细信息,请参阅