The web application I'm currently developing supports CSV export from (using SELECT INTO OUTFILE) and import to (using LOAD DATA INFILE) MySQL server to maintain huge data sets that are extremely expensive to be processed using SELECT and bulk INSERT statements in Java code (processing result sets, string encoding stuff, business logic heritage, etc). These CSV files are not application-driven, so they just represent the raw tables content from the MySQL database. But as far as I understand this approach is good only if I have local files, so both web application server and mysqld must run at the same machine.
The application configuration can specify a remote database connection. That obviously means that uploaded CSV files are stored somewhere locally at the machine where the web application is running on, so I cannot specify the data file location in MySQL LOAD DATA INFILE statement. (The same scenario is for a CSV download request). So, what I'm trying to find is a way to specify the CSV file "virtually" - using a I/O stream that could be processed by JDBC and MySQL, similarly to blobs management etc.
Does JDBC/MySQL support this technique for CSV files for import and export?
Thanks in advance.