Jump to content

upload database .sql file and import with jsp


rohanawaw

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...