use of oracle.jdbc.OracleDriver in project adempiere by adempiere.
the class DB_Oracle method getDriver.
// getStandardPort
/**
* Get and register Database Driver
* @return Driver
* @throws SQLException
*/
public Driver getDriver() throws SQLException {
if (s_driver == null) {
// Speed up transfer rate
System.setProperty("oracle.jdbc.TcpNoDelay", "true");
// Oracle Multi - Language
System.setProperty("oracle.jdbc.defaultNChar", "true");
//
s_driver = new OracleDriver();
DriverManager.registerDriver(s_driver);
DriverManager.setLoginTimeout(Database.CONNECTION_TIMEOUT);
}
return s_driver;
}
use of oracle.jdbc.OracleDriver in project adempiere by adempiere.
the class ConfigOracle method testJDBC.
// test
/**
* Test JDBC Connection to Server
* @param url connection string
* @param uid user id
* @param pwd password
* @return true if OK
*/
private boolean testJDBC(String url, String uid, String pwd) {
log.fine("Url=" + url + ", UID=" + uid);
try {
if (s_oracleDriver == null) {
s_oracleDriver = new OracleDriver();
DriverManager.registerDriver(s_oracleDriver);
}
m_con = DriverManager.getConnection(url, uid, pwd);
} catch (UnsatisfiedLinkError ule) {
log.warning("Check [ORACLE_HOME]/jdbc/Readme.txt for (OCI) driver setup");
log.warning(ule.toString());
} catch (Exception e) {
log.warning(e.toString());
return false;
}
return true;
}
use of oracle.jdbc.OracleDriver in project presto by prestodb.
the class OracleClientModule method connectionFactory.
@Provides
@Singleton
public static ConnectionFactory connectionFactory(BaseJdbcConfig config, OracleConfig oracleConfig) throws SQLException {
Properties connectionProperties = new Properties();
connectionProperties.setProperty(OracleConnection.CONNECTION_PROPERTY_INCLUDE_SYNONYMS, String.valueOf(oracleConfig.isSynonymsEnabled()));
return new DriverConnectionFactory(new OracleDriver(), config.getConnectionUrl(), Optional.empty(), Optional.empty(), connectionProperties);
}
Aggregations