static void initializeDatabaseDriver ( String databaseType ) { String driverClass = System . getProperty ( JDBC_DRIVER_CLASS_KEY_PREFIX + databaseType ) ; if ( driverClass != null ) { Log . debug ( "Loading " + driverClass + " to initialize database of type " + databaseType ) ; try { Class . forName ( driverClass ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "Connection to '" + databaseType + "' database is not possible due to missing JDBC driver. " + "User specified driver class: " + driverClass , e ) ; } return ; } // use built-in defaults switch ( databaseType ) { case HIVE_DB_TYPE : try { Class . forName ( HIVE_JDBC_DRIVER_CLASS ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "Connection to HIVE database is not possible due to missing JDBC driver." , e ) ; } break ; case NETEZZA_DB_TYPE : try { Class . forName ( NETEZZA_JDBC_DRIVER_CLASS ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "Connection to Netezza database is not possible due to missing JDBC driver." , e ) ; } break ; default : //nothing to do } }
Initializes database driver for databases with JDBC driver version lower than 4 . 0