Jump to content

Recommended Posts

Posted

You should be able to just read the file in, then execute all the queries inside in order as one big block of code. They are just plain text after all.

 

We don't allow shell commands except through cron (and those are limited to 2 per day).

Posted (edited)

can i use load inline query

 String sql= "LOAD DATA INFILE"+" 'f:/data4.txt'"
            +"INTO TABLE survey "+
           " FIELDS TERMINATED BY ',' "+
           " ENCLOSED BY '\"'"+
            "LINES TERMINATED BY '\\r\\n'"+
            "IGNORE 1 LINES";
          
 
statement.execute(sql);

 

from java with remote .

 

currently iam doing this it giving me error

access denied

Edited by rohanawaw
Posted

The file needs to be on the server, not your computer, so the file f:/data4.txt would never be accessible. Upload it to your home folder and point to the copy you uploaded there. It'll be found at either /home/username/data4.txt or /home1/username/data4.txt assuming you put it in the root of your home directory.

 

Also, be aware that that function expects the data only, usually in comma separated form. It won't accept entire queries.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...