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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...