private void readSourceDeclaration ( LineNumberReader reader ) throws IOException { String line ; dataSourceProperties = new Properties ( ) ; while ( ! ( line = reader . readLine ( ) ) . isEmpty ( ) ) { int lineNumber = reader . getLineNumber ( ) ; String [ ] tokens = line . split ( "[\t| ]+" , 2 ) ; final String parameter = tokens [ 0 ] . trim ( ) ; final String inputParameter = tokens [ 1 ] . trim ( ) ; if ( parameter . equals ( Label . sourceUri . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_NAME , inputParameter ) ; } else if ( parameter . equals ( Label . connectionUrl . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_URL , inputParameter ) ; } else if ( parameter . equals ( Label . username . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCredentialSettings . JDBC_USER , inputParameter ) ; } else if ( parameter . equals ( Label . password . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCredentialSettings . JDBC_PASSWORD , inputParameter ) ; } else if ( parameter . equals ( Label . driverClass . name ( ) ) ) { dataSourceProperties . put ( OntopSQLCoreSettings . JDBC_DRIVER , inputParameter ) ; } else { String msg = String . format ( "Unknown parameter name \"%s\" at line: %d." , parameter , lineNumber ) ; throw new IOException ( msg ) ; } } }
read and store datasource information