Java sql linking code