When the Compiler processes the code, it creates a list of all Identifiers that are in use. Basically, it checks to make sure all those things exist and are defined correctly. If the Compiler cannot figure out what an Identifier is referring to, it will generate a cannot find symbol error message.
Line 18 makes reference to the Apache Commons library BasicDataSource class. How are you importing the org.apache.commons.dbcp.BasicDataSource class into your class?