I have this method to import data from a CSV file. But the method adds only the PID. Any sugestion to fix this??
public void importData(){
try{
Import path = new Import();
String filename = path.getFileName();
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test");
st = con.createStatement(rs.TYPE_SCROLL_SENSITIVE, rs.CONCUR_UPDATABLE);
String query = "LOAD DATA LOCAL INFILE '" + filename + "' INTO TABLE Pacient (PID, Nume,Prenume, Varsta, CNP, Adresa);";
st.execute(query);
}
catch (SQLException | HeadlessException e){
e.printStackTrace();
}
catch (Exception e){
e.printStackTrace();
st = null;
}
}