Java Portion - Connects to Database