How do you communicate with the remote machine to get access to the data? HTTP? (S)FTP? Something else?
Also, you shouldn't be building SQL statements by concatenating strings, as that's vulnerable to SQL injection.
Also, you shouldn't be building SQL statements by concatenating strings, as that's vulnerable to SQL injection.