Guest User

Untitled

a guest
Mar 5th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import java.sql.*;
  2.  
  3. public class populate {
  4.  
  5. public static void main(String[] args) throws SQLException {
  6.  
  7. Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/IMDB","root","user");
  8. Statement stmt = con.createStatement();
  9. String sql =
  10. "load data local infile 'titles.csv' n" +
  11. " replace n" +
  12. " into table Titles n" +
  13. " columns terminated by '\t' n" +
  14. " ignore 1 lines";
  15. stmt.execute(sql);
  16. }
  17. }
Add Comment
Please, Sign In to add comment