Search in sources :

Example 1 with OracleDriver

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;
}
Also used : OracleDriver(oracle.jdbc.OracleDriver)

Example 2 with OracleDriver

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;
}
Also used : OracleDriver(oracle.jdbc.OracleDriver) IOException(java.io.IOException)

Example 3 with OracleDriver

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);
}
Also used : DriverConnectionFactory(com.facebook.presto.plugin.jdbc.DriverConnectionFactory) Properties(java.util.Properties) OracleDriver(oracle.jdbc.OracleDriver) Singleton(com.google.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

OracleDriver (oracle.jdbc.OracleDriver)3 DriverConnectionFactory (com.facebook.presto.plugin.jdbc.DriverConnectionFactory)1 Provides (com.google.inject.Provides)1 Singleton (com.google.inject.Singleton)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1