/** * PUBLIC: * The driver class is the name of the Java class for the JDBC driver being used * (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). */ public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; // if driver class name changed then discard the cached driver class and driver. clearDriverClassAndDriver(); }
/** * PUBLIC: * The driver class is the name of the Java class for the JDBC driver being used * (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). */ public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; // if driver class name changed then discard the cached driver class and driver. clearDriverClassAndDriver(); }
/** * PUBLIC: * The driver class is the name of the Java class for the JDBC driver being used * (e.g. "sun.jdbc.odbc.JdbcOdbcDriver"). */ public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; // if driver class name changed then discard the cached driver class and driver. clearDriverClassAndDriver(); }
/** * INTERNAL: * Instantiate the Driver. */ protected void instantiateDriver() throws DatabaseException { try { if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try{ this.driver = (Driver)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(this.driverClass)); }catch (PrivilegedActionException ex){ if (ex.getCause() instanceof IllegalAccessException){ throw (IllegalAccessException)ex.getCause(); }else if (ex.getCause() instanceof InstantiationException){ throw (InstantiationException)ex.getCause(); } throw (RuntimeException)ex.getCause(); } }else{ this.driver = (Driver)PrivilegedAccessHelper.newInstanceFromClass(this.driverClass); } } catch (InstantiationException ie) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceInstantiationException(ie, driverClass); } catch (IllegalAccessException iae) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceIllegalAccessException(iae, driverClass); } }
/** * INTERNAL: * Instantiate the Driver. */ protected void instantiateDriver() throws DatabaseException { try { if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try{ this.driver = (Driver)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(this.driverClass)); }catch (PrivilegedActionException ex){ if (ex.getCause() instanceof IllegalAccessException){ throw (IllegalAccessException)ex.getCause(); }else if (ex.getCause() instanceof InstantiationException){ throw (InstantiationException)ex.getCause(); } throw (RuntimeException)ex.getCause(); } }else{ this.driver = (Driver)PrivilegedAccessHelper.newInstanceFromClass(this.driverClass); } } catch (InstantiationException ie) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceInstantiationException(ie, driverClass); } catch (IllegalAccessException iae) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceIllegalAccessException(iae, driverClass); } }
/** * INTERNAL: * Connect directly - without using DriverManager. Return the Connection. * @return java.sql.Connection */ protected Connection directConnect(Properties properties) throws DatabaseException { if(this.driver == null) { this.instantiateDriver(); } try { return this.driver.connect(this.getConnectionString(), properties); } catch (SQLException exception) { this.clearDriverClassAndDriver(); throw DatabaseException.sqlException(exception, true); } }
/** * INTERNAL: * Connect directly - without using DriverManager. Return the Connection. * @return java.sql.Connection */ protected Connection directConnect(Properties properties) throws DatabaseException { if(this.driver == null) { this.instantiateDriver(); } try { return this.driver.connect(this.getConnectionString(), properties); } catch (SQLException exception) { this.clearDriverClassAndDriver(); throw DatabaseException.sqlException(exception, true); } }
/** * INTERNAL: * Connect directly - without using DriverManager. Return the Connection. * @return java.sql.Connection */ protected Connection directConnect(Properties properties) throws DatabaseException { if(this.driver == null) { this.instantiateDriver(); } try { return this.driver.connect(this.getConnectionString(), properties); } catch (SQLException exception) { this.clearDriverClassAndDriver(); throw DatabaseException.sqlException(exception, true); } }
/** * INTERNAL: * Instantiate the Driver. * @return void */ protected void instantiateDriver() throws DatabaseException { try { if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try{ this.driver = (Driver)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(this.driverClass)); }catch (PrivilegedActionException ex){ if (ex.getCause() instanceof IllegalAccessException){ throw (IllegalAccessException)ex.getCause(); }else if (ex.getCause() instanceof InstantiationException){ throw (InstantiationException)ex.getCause(); } throw (RuntimeException)ex.getCause(); } }else{ this.driver = (Driver)PrivilegedAccessHelper.newInstanceFromClass(this.driverClass); } } catch (InstantiationException ie) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceInstantiationException(ie, driverClass); } catch (IllegalAccessException iae) { this.clearDriverClassAndDriver(); throw DatabaseException.configurationErrorNewInstanceIllegalAccessException(iae, driverClass); } }
clearDriverClassAndDriver(); throw DatabaseException.configurationErrorClassNotFound(this.getDriverClassName());
clearDriverClassAndDriver(); throw DatabaseException.configurationErrorClassNotFound(this.getDriverClassName());
clearDriverClassAndDriver(); throw DatabaseException.configurationErrorClassNotFound(this.getDriverClassName());